From 90e8a6f5e9b227a3df70ea0c3a6a1b5d9a28e02f Mon Sep 17 00:00:00 2001 From: Vinzent Date: Sat, 27 Jan 2024 23:44:34 +0100 Subject: [PATCH 1/2] feat: add token hash to verifyOtp --- packages/gotrue/lib/src/gotrue_client.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/gotrue/lib/src/gotrue_client.dart b/packages/gotrue/lib/src/gotrue_client.dart index b315033c..ccff38dc 100644 --- a/packages/gotrue/lib/src/gotrue_client.dart +++ b/packages/gotrue/lib/src/gotrue_client.dart @@ -479,6 +479,8 @@ class GoTrueClient { /// [phone] is the user's phone number WITH international prefix /// /// [token] is the token that user was sent to their mobile phone + /// + /// [tokenHash] is the token used in an email link Future verifyOTP({ String? email, String? phone, @@ -486,6 +488,7 @@ class GoTrueClient { 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.'); @@ -501,6 +504,7 @@ class GoTrueClient { 'type': type.snakeCase, 'redirect_to': redirectTo, 'gotrue_meta_security': {'captchaToken': captchaToken}, + if (tokenHash != null) 'token_hash': tokenHash, }; final fetchOptions = GotrueRequestOptions(headers: _headers, body: body); final response = await _fetch From be14864a40662e07de2aa34b900663980e123815 Mon Sep 17 00:00:00 2001 From: Vinzent Date: Sat, 27 Jan 2024 23:50:19 +0100 Subject: [PATCH 2/2] style: format --- packages/gotrue/lib/src/gotrue_client.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gotrue/lib/src/gotrue_client.dart b/packages/gotrue/lib/src/gotrue_client.dart index ccff38dc..3b855768 100644 --- a/packages/gotrue/lib/src/gotrue_client.dart +++ b/packages/gotrue/lib/src/gotrue_client.dart @@ -479,8 +479,8 @@ class GoTrueClient { /// [phone] is the user's phone number WITH international prefix /// /// [token] is the token that user was sent to their mobile phone - /// - /// [tokenHash] is the token used in an email link + /// + /// [tokenHash] is the token used in an email link Future verifyOTP({ String? email, String? phone,