I'm trying to utilize the Firebase Auth sendPasswordResetEmail() call in my app.
In my auth file I declare the following:
Future<void> sendPasswordResetEmail(String email) async {
return _firebaseAuth.sendPasswordResetEmail(email: email);
}
I pass the Auth to my a form widget that takes in this password and has the following onPressed function once I submit.
onPressed: () async {
var response = await checkEmail();
setState(() {
this._emailValidator = response;
});
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
try {
await widget.auth
.sendPasswordResetEmail(_email);
} catch (e) {
print(e);
}
}
},
I get the following console message after running it with a proper email:
"Tried calling: sendPasswordResetEmail("[email protected]")" Note: I used a real email for this.
I've set up the Firebase email template system but have not received any email. Does anyone know how I can further troubleshoot this or why my email is not working?
Thanks!
Enable Email Link sign-in for your Firebase project. To sign in users by email link, you must first enable the Email provider and Email link sign-in method for your Firebase project: In the Firebase console, open the Auth section. On the Sign in method tab, enable the Email/Password provider.
I figured this out. I was not correctly passing the auth down from my auth file to the new file. As such, the method was being called on null, resulting in NoSuchMethodError.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With