requireVerifiedEmail static method

void requireVerifiedEmail(
  1. FirebaseAccountDetails accountDetails
)

Validation function that requires the email to be verified when present.

Throws a FirebaseEmailNotVerifiedException if an email is present but has not been verified. Accounts without an email (e.g. phone authentication) are accepted.

Note that with Firebase Email/Password sign-in this blocks users from signing in between signup and clicking the verification link Firebase emails them.

Implementation

static void requireVerifiedEmail(
  final FirebaseAccountDetails accountDetails,
) {
  if (accountDetails.email != null && accountDetails.verifiedEmail != true) {
    throw FirebaseEmailNotVerifiedException();
  }
}