signInWithEmailLink method Null safety

Future<UserCredential> signInWithEmailLink(
  1. {required String email,
  2. required String emailLink}
)

Signs in using an email address and email sign-in link.

Fails with an error if the email address is invalid or OTP in email link expires.

Confirm the link is a sign-in email link before calling this method, using isSignInWithEmailLink.

A FirebaseAuthException maybe thrown with the following error code:

  • expired-action-code:
  • Thrown if OTP in email link expires.
  • invalid-email:
  • Thrown if the email address is not valid.
  • user-disabled:
  • Thrown if the user corresponding to the given email has been disabled.

Implementation

Future<UserCredential> signInWithEmailLink({
  required String email,
  required String emailLink,
}) async {
  try {
    return UserCredential._(
      this,
      await _delegate.signInWithEmailLink(email, emailLink),
    );
  } on FirebaseAuthMultiFactorExceptionPlatform catch (e) {
    throw FirebaseAuthMultiFactorException._(this, e);
  } catch (e) {
    rethrow;
  }
}