MCPcopy Create free account
hub / github.com/firebase/quickstart-js / sendPasswordReset

Function sendPasswordReset

auth/email-password.ts:115–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115function sendPasswordReset() {
116 const email = emailInput.value;
117 sendPasswordResetEmail(auth, email)
118 .then(function () {
119 // Password Reset Email Sent!
120 alert('Password Reset Email Sent!');
121 })
122 .catch(function (error) {
123 // Handle Errors here.
124 const errorCode = error.code;
125 const errorMessage = error.message;
126 if (errorCode == 'auth/invalid-email') {
127 alert(errorMessage);
128 } else if (errorCode == 'auth/user-not-found') {
129 alert(errorMessage);
130 }
131 console.log(error);
132 });
133}
134
135// Listening for auth state changes.
136onAuthStateChanged(auth, function (user) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected