Skip to content

Commit

Permalink
fix: Make token in verifyOtp nullable (#950)
Browse files Browse the repository at this point in the history
fix: make token in verifyOtp nullable
  • Loading branch information
Vinzent03 authored Jun 17, 2024
1 parent 691a8b5 commit 0e69c58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,21 @@ class GoTrueClient {
Future<AuthResponse> verifyOTP({
String? email,
String? phone,
required String token,
String? token,
required OtpType type,
String? redirectTo,
String? captchaToken,
String? tokenHash,
}) async {
assert((email != null && phone == null) || (email == null && phone != null),
'`email` or `phone` needs to be specified.');
assert(token != null || tokenHash != null,
'`token` or `tokenHash` needs to be specified.');

final body = {
if (email != null) 'email': email,
if (phone != null) 'phone': phone,
'token': token,
if (token != null) 'token': token,
'type': type.snakeCase,
'redirect_to': redirectTo,
'gotrue_meta_security': {'captchaToken': captchaToken},
Expand Down

0 comments on commit 0e69c58

Please sign in to comment.