Skip to content

Conversation

dshukertjr
Copy link
Member

What kind of change does this PR introduce?

Calling auth.verifyOtp() method with the 6-digit OTP returns an AuthResponse with null session. The supabase_flutter SDK currently however does not allow null session returned from the verifyOtp() method, but this PR enables empty session to be returned.

Comment on lines -498 to -501
if (authResponse.session == null) {
throw AuthException(
'An error occurred on token verification.',
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece of code is mirroring this js SDK code, but we actually need to allow empty session.

We shouldn't need the !data check equivalent here, because _fetch.request will throw if it did not have any response data.

@dshukertjr dshukertjr changed the title fix: allow empty session response for verifyOtp method fix(gotrue): allow empty session response for verifyOtp method Oct 25, 2023
@dshukertjr dshukertjr merged commit dc6146d into main Oct 25, 2023
@dshukertjr dshukertjr deleted the fix/verifyOtp branch October 25, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants