-
-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: PKCE flow not emitting password recovery event #744
Conversation
|
|
||
final session = authResponse.session; | ||
if (session != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got rid of this check for session.
The signature of the return type on the js SDK guarantees that there is a session, so not sure why the js SDK has the check for session there.
https://github.com/supabase/gotrue-js/blob/master/src/GoTrueClient.ts#L534
@Vinzent03 |
if (session == null) { | ||
throw AuthPKCEGrantCodeExchangeError( | ||
'No session found for the auth code.'); | ||
} | ||
|
||
return AuthSessionUrlResponse(session: session, redirectType: null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of exchangeCodeForSession
can directly be returned. Currently, redirectType
is still null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have caught that one myself. Should be fixed now!
What kind of change does this PR introduce?
Currently with PKCE flow,
passwordRecovery
auth event is not emitted for email password reset flow. This PR fixes it.What is the current behavior?
signIn
event is emitted after clicking on the link sent to the email.What is the new behavior?
passwordRecovery
event is emitted after opening the link sent to the email.Additional context
Fixes #664