Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthResponse> signUp({
String? email,
String? phone,
Expand All @@ -198,6 +200,7 @@ class GoTrueClient {
Map<String, dynamic>? 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');
Expand Down Expand Up @@ -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);
}
Expand Down
Loading