Please include the following information in your post:
- Which SDK this is regarding: Nextjs-auth0
- SDK Version: latest
- Platform Version: where do I get this?
- Code Snippets/Error Messages/Supporting Details/Screenshots:
So I’m aware of this: handlers/login | @auth0/nextjs-auth0
and I know I can return “returnTo” with some path value to have user redirected to some page. But how to do it conditonally? I cannot seem to figure out how to get the user profile there. Neither the req or loginOptions seem to contain anything useful either.
The flow I’m going after is this:
- User authenticates on auth0 view
- User is redirected to their specific dashboard after redirect, post authentication.
But it does not seem possible. since
- If I try to do it with nextjs redirects (next.config.js: Redirects | Next.js) then the information about the profile is not accessible there
- If I try to do it with this handleLogin - again information seems to not be available
- By creating a single landing view and then redirecting when the user roles are available, results in an empty view rendering until the role is available through useUser.
Any ideas on how to approach the issue are welcome.