Auth0 logout redirect

Hello,

Upon logout, my app is currently staying on auth0 site. I want to redirect it back to my site. I wonder how that is currently implemented. It looks like it’s not implemented. Maybe I miss something. Can someone point me to the documentation?

Thanks,

Phuoc Do

I think the fix is to allow options in logOut call here:

Then I can pass a returnTo parameter to Auth0.

Hi @dnprock! I believe you can handle this from the Auth0 account settings (at least it worked for my account when I tried it). Go to the “Application” left column nav item and find the section “Application URIs” – you can enter the URL in “Allowed Callback URLs” and it works for me on local dev.

But this definitely isn’t very dynamic.

@peterp what do you think about the possibility of updating Redwood’s Auth0 useAuth().logOut to allow an attribute like logOut({ returnTo: 'http://localhost:3000/' })? (Based on this Auth0 documentation.)

Here’s the source code. @dnprock would you want to take a stab at adding this? No pressure, but I’m sure it would be of help to others as well!

@thedavid thanks for the tip about Allowed Logout URLs. I can get redirect locally now.

@peterp I make a patch to send options to auth clients. It would allow us to send in returnTo.

1 Like