use-auth0-hooks
use-auth0-hooks copied to clipboard
logout() Expected Behavior
Hello! I'm making a very simple application as a side project just to experiment with next.js and auth0 a little bit more and get back into some engineering. I had a question about the default behavior expectations for some of these APIs - I'm not sure if some of this is associated with auth0 behavior or with this library. Sorry if this is obvious and/or in the wrong place!
Given an <Auth0Provider redirectUri={process.env.PROD_OR_LOCAL_HOST} />
scenario, in which the base redirect will either be the deployed environment, or https://localhost:3000/
by default when developing, what would you expect to occur when calling logout()
with no additional options?
I had expected to be redirect to Auth0, and then back to localhost:3000
- however I'm redirected back to my production environment.
Looking through the code it seems these are unaware of any provider level props, and they don't account for or attempt to merge any defaults in.
Would that be worth adding in here, or is that a nice DX at the expense of a poor API augmentation? It seems the work around is to only ever invoke logout()
with the correct environment-aware returnTo
variable, otherwise you wind up back in production based on the Auth0 default behavior.
All of the concepts of this library have been moved to the official Auth0 SDK for React (https://github.com/auth0/auth0-react), so I'll be archiving this repository shortly.