Skip to content

Commit

Permalink
fix(gotrue): Fix the issue where verfiyOTP emits signIn instead o…
Browse files Browse the repository at this point in the history
…f `passwordRecovery` auth event. (#774)

Fix #773: verfiyOTP fails to emit AuthChangeEvent.passwordRecovery

This PR fixes issue #773: verifyOTP should emit AuthChangeEvent.passwordRecovery instead of AuthChangeEvent.signedIn when OtpType.recovery is passed
  • Loading branch information
point-source committed Dec 30, 2023
1 parent 13f0228 commit fc42613
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ class GoTrueClient {
}

_saveSession(authResponse.session!);
notifyAllSubscribers(AuthChangeEvent.signedIn);
notifyAllSubscribers(type == OtpType.recovery
? AuthChangeEvent.passwordRecovery
: AuthChangeEvent.signedIn);

return authResponse;
}
Expand Down

0 comments on commit fc42613

Please sign in to comment.