Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I not getting a password reset email from the Firebase service?

I am trying to implement a password reset function that incorporates a SnackBar to display either success or error messages. The code shown below produces both the success message and the various error messages, as appropriate - but I never receive the password reset email from the Firebase service. I'm not sure if it's a Firebase setup issue or an issue with the code.

Future resetPassword() async {
    try {
      await FirebaseAuth.instance
          .sendPasswordResetEmail(email: _emailController.text.trim());
      _showSnackBar('Password reset link sent');
    } on FirebaseAuthException catch (e) {
      _showSnackBar(e.message.toString());
      return;
    }
  }

  Future<void> _showSnackBar(String msg) async {
    final snackBar = SnackBar(
      content: Text(msg),
    );
    ScaffoldMessenger.of(context).showSnackBar(snackBar);
  }
like image 537
Andy Avatar asked Dec 11 '25 04:12

Andy


1 Answers

Make sure to check your spam, because if did not add authorize rules in firebase then the reset link goes in spam mail. .

like image 64
Techno Soft Avatar answered Dec 13 '25 21:12

Techno Soft