sendLoginEmail method

  1. @override
Future<Either<AuthServiceSignInFailure, Unit>> sendLoginEmail(
  1. String email
)
override

Implementation

@override
Future<Either<AuthServiceSignInFailure, Unit>> sendLoginEmail(String email) async {
  try {
    await authCallable.call({
      'action': 'emailLoginLink',
      'email': email,
      //TODO: pass the bundle ID or something like that to know whihc app is calling. Using isForApp is legacy and should be removed after the existing functions are updated
      'isForApp': !kIsWeb,
    });

    // if (result.data['result'] == 'exists') {
    //   return left(AuthServiceSignInFailure.userAlreadyExists);
    // }

    // logd('sendLoginEmail result: ${result.data}');

    return right(unit);
  } catch (e) {
    return left(AuthServiceSignInFailure.unexpected);
  }
}