Skip to content

Commit c73e577

Browse files
saveSession option in goture_client signUp method
1 parent 1a3c3f7 commit c73e577

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/gotrue/lib/src/gotrue_client.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ class GoTrueClient {
190190
/// [data] sets [User.userMetadata] without an extra call to [updateUser]
191191
///
192192
/// [channel] Messaging channel to use (e.g. whatsapp or sms)
193+
///
194+
/// [saveSession] save the user session after signUp
193195
Future<AuthResponse> signUp({
194196
String? email,
195197
String? phone,
@@ -198,6 +200,7 @@ class GoTrueClient {
198200
Map<String, dynamic>? data,
199201
String? captchaToken,
200202
OtpChannel channel = OtpChannel.sms,
203+
bool saveSession = true,
201204
}) async {
202205
assert((email != null && phone == null) || (email == null && phone != null),
203206
'You must provide either an email or phone number');
@@ -252,7 +255,7 @@ class GoTrueClient {
252255
final authResponse = AuthResponse.fromJson(response);
253256

254257
final session = authResponse.session;
255-
if (session != null) {
258+
if (session != null && saveSession) {
256259
_saveSession(session);
257260
notifyAllSubscribers(AuthChangeEvent.signedIn);
258261
}

0 commit comments

Comments
 (0)