You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add functionallity to my application so that non-authenticated users that attempt to hit privileged pages will be redirected to sign in, then after signing in/resetting their password they'll be redirected back to the page they previously attempted to hit.
Doing this requires maintinaing some state during all the authentication flows so I know where to send the users back to after they have completed.
What I've got so far
I've been able to do this for:
sign in with email + password (all handled in my app)
sign in with google (I sent the url to redirect back to via the context in signInWithProvider and I am able to get it back from the return value in handleSignInRedirect)
Where I'm having issues
I've not been able to do this for the reset password flow. Ideally the flow would be:
Unauthenticated user hits /privilidged-page/1
Redirected to /sign-in?redirectTo=%2Fprivilidged-page%2F1
User clicks reset password and inputs their email, we then call sendOobCode('PASSWORD_RESET', email)
User follows link in reset password flow
User completes reset password flow and is redirect to /privilidged-page/1
Is there a way for me to pass state between 3, 4 and 5? Ideally I'd be able to pass some context to sendOobCode, like we can to signInWithProvider.
I can see in sendOobCode that currently a continueUrl is sent. The firebase docs state can be used for my purpose, but it looks like it's being leveraged for another purpose in this library (magic link sign in, I think):
What I want to achieve
I'd like to add functionallity to my application so that non-authenticated users that attempt to hit privileged pages will be redirected to sign in, then after signing in/resetting their password they'll be redirected back to the page they previously attempted to hit.
Doing this requires maintinaing some state during all the authentication flows so I know where to send the users back to after they have completed.
What I've got so far
I've been able to do this for:
signInWithProvider
and I am able to get it back from the return value inhandleSignInRedirect
)Where I'm having issues
I've not been able to do this for the reset password flow. Ideally the flow would be:
/privilidged-page/1
/sign-in?redirectTo=%2Fprivilidged-page%2F1
sendOobCode('PASSWORD_RESET', email)
/privilidged-page/1
Is there a way for me to pass state between 3, 4 and 5? Ideally I'd be able to pass some context to
sendOobCode
, like we can tosignInWithProvider
.I can see in
sendOobCode
that currently acontinueUrl
is sent. The firebase docs state can be used for my purpose, but it looks like it's being leveraged for another purpose in this library (magic link sign in, I think):firebase-auth-lite/src/main.js
Line 382 in d4ed969
The text was updated successfully, but these errors were encountered: