Skip to content

Commit fc42613

Browse files
authored
fix(gotrue): Fix the issue where verfiyOTP emits signIn instead of passwordRecovery auth event. (supabase#774)
Fix supabase#773: verfiyOTP fails to emit AuthChangeEvent.passwordRecovery This PR fixes issue supabase#773: verifyOTP should emit AuthChangeEvent.passwordRecovery instead of AuthChangeEvent.signedIn when OtpType.recovery is passed
1 parent 13f0228 commit fc42613

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/gotrue/lib/src/gotrue_client.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ class GoTrueClient {
509509
}
510510

511511
_saveSession(authResponse.session!);
512-
notifyAllSubscribers(AuthChangeEvent.signedIn);
512+
notifyAllSubscribers(type == OtpType.recovery
513+
? AuthChangeEvent.passwordRecovery
514+
: AuthChangeEvent.signedIn);
513515

514516
return authResponse;
515517
}

0 commit comments

Comments
 (0)