Skip to content

Commit dc6146d

Browse files
authored
fix(gotrue): allow empty session response for verifyOtp method (supabase#680)
fix: allow empty session response for verifyOtp method
1 parent 52a84c4 commit dc6146d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/gotrue/lib/src/gotrue_client.dart

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,15 +495,11 @@ class GoTrueClient {
495495

496496
final authResponse = AuthResponse.fromJson(response);
497497

498-
if (authResponse.session == null) {
499-
throw AuthException(
500-
'An error occurred on token verification.',
501-
);
498+
if (authResponse.session != null) {
499+
_saveSession(authResponse.session!);
500+
_notifyAllSubscribers(AuthChangeEvent.signedIn);
502501
}
503502

504-
_saveSession(authResponse.session!);
505-
_notifyAllSubscribers(AuthChangeEvent.signedIn);
506-
507503
return authResponse;
508504
}
509505

0 commit comments

Comments
 (0)