From c73e5774843a2eb21de35e7e995212ada49340c4 Mon Sep 17 00:00:00 2001 From: htoopyaelinn56 Date: Fri, 4 Oct 2024 06:25:32 +0630 Subject: [PATCH] saveSession option in goture_client signUp method --- packages/gotrue/lib/src/gotrue_client.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gotrue/lib/src/gotrue_client.dart b/packages/gotrue/lib/src/gotrue_client.dart index 8a2c0e2b1..f307421c7 100644 --- a/packages/gotrue/lib/src/gotrue_client.dart +++ b/packages/gotrue/lib/src/gotrue_client.dart @@ -190,6 +190,8 @@ class GoTrueClient { /// [data] sets [User.userMetadata] without an extra call to [updateUser] /// /// [channel] Messaging channel to use (e.g. whatsapp or sms) + /// + /// [saveSession] save the user session after signUp Future signUp({ String? email, String? phone, @@ -198,6 +200,7 @@ class GoTrueClient { Map? data, String? captchaToken, OtpChannel channel = OtpChannel.sms, + bool saveSession = true, }) async { assert((email != null && phone == null) || (email == null && phone != null), 'You must provide either an email or phone number'); @@ -252,7 +255,7 @@ class GoTrueClient { final authResponse = AuthResponse.fromJson(response); final session = authResponse.session; - if (session != null) { + if (session != null && saveSession) { _saveSession(session); notifyAllSubscribers(AuthChangeEvent.signedIn); }