Skip to content

Commit

Permalink
fix(gotrue): only remove session in otp verification if it's not emai…
Browse files Browse the repository at this point in the history
…l change or phone change (#514)

fix: only remove session in otp verification if it's not email change or phone change
  • Loading branch information
dshukertjr committed Jun 13, 2023
1 parent 3ef1614 commit 23bed82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ class GoTrueClient {
assert((email != null && phone == null) || (email == null && phone != null),
'`email` or `phone` needs to be specified.');

_removeSession();
if (type != OtpType.emailChange && type != OtpType.phoneChange) {
_removeSession();
}

final body = {
if (email != null) 'email': email,
Expand Down

0 comments on commit 23bed82

Please sign in to comment.