Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gotrue): allow empty session response for verifyOtp method #680

Merged
merged 1 commit into from
Oct 25, 2023

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
10 checks passed
@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.

None yet

2 participants