Replies: 1 comment
-
@hmdegroot stumped as well. how do you handle user flows like profile edit and forgot password? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have a situation that doesn't seem like a crazy ask to me. I have two paths to log in. One is for the general public, one is for internal admin staff. If you go to the website and are not authenticated, you are auto directed to the general login. If you point to auth/admin (or whatever url we pick) you should be redirect to the admin login. I'm using azureb2c for both.
The problem: going to auth/admin, I need to pass a different primaryUserFlow in order to redirect the user to the correct b2c login page. Currently, I have a hack that I hate - code below. The middleware watches for the path, adds a 30 second cookie that flags the user as logging in as admin. Then when they get to the options I check the cookie value and pass the correct policy. There are a few ways this could go south for the user. I'm looking for an alternative solution but I'm pretty stumped.
FYI, using nextauth 4 & nextjs 14
//middleware.ts
//route.ts
//options.ts
Beta Was this translation helpful? Give feedback.
All reactions