Auth0-spa-js, passing returnTo to logout not working

Hey all,

I am passing the returnTo parameter to my logout function. However, upon log out the redirect to the logout/v2 endpoint has my client id, but doesn’t specify the return to parameter. It’s not getting set on the logout request… Any insights on why or how this could happen?

const logout = useCallback(async () => {
    console.log("auth0 logout called.");
    const logoutOptions = {returnTo: "https://app.test.com"};
    auth0Client?.logout(logoutOptions);
    dispatch({
      type: 'LOGOUT',
    });
  }, []);

I solved this, apparently with auth0-spa-js you need to add a top level logoutParams:

auth0Client?.logout({logoutParams:{returnTo: window.location.origin}});

Hey @joshy welcome to the community and good to know you were able to resolve this - Thanks a bunch for following up with the community! :smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.