anonymousSignUp function

Future<bool> anonymousSignUp()

Implementation

Future<bool> anonymousSignUp() async {
  final fakeUserEmail = '${const Uuid().v4()}@$fakeStudyUEmailDomain';
  final fakeUserPassword = const Uuid().v4();
  try {
    final authResponse = await Supabase.instance.client.auth.signUp(email: fakeUserEmail, password: fakeUserPassword);
    await storeFakeUserEmailAndPassword(fakeUserEmail, fakeUserPassword);
    return authResponse.session != null ? true : await signInParticipant();
  } catch (error, stacktrace) {
    SupabaseQuery.catchSupabaseException(error, stacktrace);
    return false;
  }
}