Skip to content

Commit

Permalink
fix: skip signin after signup if user is already authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvedder committed Apr 25, 2024
1 parent 0e50c7a commit 7e97812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flutter_common/lib/src/utils/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Future<bool> anonymousSignUp() async {
final fakeUserEmail = '${const Uuid().v4()}@$fakeStudyUEmailDomain';
final fakeUserPassword = const Uuid().v4();
try {
await Supabase.instance.client.auth.signUp(email: fakeUserEmail, password: fakeUserPassword);
final authResponse = await Supabase.instance.client.auth.signUp(email: fakeUserEmail, password: fakeUserPassword);
await storeFakeUserEmailAndPassword(fakeUserEmail, fakeUserPassword);
return signInParticipant();
return authResponse.session != null ? true : await signInParticipant();
} catch (error, stacktrace) {
SupabaseQuery.catchSupabaseException(error, stacktrace);
return false;
Expand Down

0 comments on commit 7e97812

Please sign in to comment.