0

I have a problem with firebase Authentication when i do verification by sendEmailVerification(), I don't receive any message in my email My code

ElevatedButton(
  onPressed: () async {
    try {
      userCredential = await FirebaseAuth.instance
          .signInWithEmailAndPassword(
              email: 'ibrahim.1995.ho@gmail.com',
              password: 'tod123456tod');
    } on FirebaseAuthException catch (e) {
      if (e.code == 'user-not-found') {
        print('No user found for that email.');
      } else if (e.code == 'wrong-password') {
        print('Wrong password provided for that user.');
      }
    };
    print(userCredential.user?.emailVerified);
    if (userCredential.user?.emailVerified == false) {
      final user = FirebaseAuth.instance.currentUser;
      await user?.sendEmailVerification();
      print(user?.email);
    }
  },
  child: Text('Sign in'),
),
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
AHMAD Tod
  • 1
  • 1
  • Many messages from Firebase Authentication have been identified as spam recently. Did you check your spam folder? https://stackoverflow.com/questions/72922475/why-did-this-code-fail-to-send-password-reset-link-in-firebase/72922603#72922603 – Frank van Puffelen Aug 28 '22 at 10:33
  • And does this line `print(user?.email);` print user's email? (so we are sure the `sendEmailVerification` method was called). – Peter Obiechina Aug 28 '22 at 11:13
  • thank you so much @FrankvanPuffelen ,Really, the messages were going to the spam – AHMAD Tod Aug 28 '22 at 12:32

0 Answers0