Skip to content

Commit

Permalink
fix(gotrue): allow empty session response for verifyOtp method (#680)
Browse files Browse the repository at this point in the history
fix: allow empty session response for verifyOtp method
  • Loading branch information
dshukertjr committed Oct 25, 2023
1 parent 52a84c4 commit dc6146d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,11 @@ class GoTrueClient {

final authResponse = AuthResponse.fromJson(response);

if (authResponse.session == null) {
throw AuthException(
'An error occurred on token verification.',
);
if (authResponse.session != null) {
_saveSession(authResponse.session!);
_notifyAllSubscribers(AuthChangeEvent.signedIn);
}

_saveSession(authResponse.session!);
_notifyAllSubscribers(AuthChangeEvent.signedIn);

return authResponse;
}

Expand Down

0 comments on commit dc6146d

Please sign in to comment.