redirect after sign up, emailAndPassword
can I redirect the user based on role? if it is a normal user, redirect to '/dashboard', if it is an admin '/admin'.
How do you guys handle this?
1 Reply
You will have to write code to do this, so remove the
callbackURL
.
Inside the SignIn.email, you can pass a 2nd argument, so pass an object and use the onSuccess
callback method.
From there, you'll need to run getSession
to get the full user object to determine the role, then redirect based on roles