function handleResetPassword(auth, actionCode, continueUrl, lang) {
// Localize the UI to the selected language as determined by the lang
// parameter.
var accountEmail;
// Verify the password reset code is valid.
auth.verifyPasswordResetCode(actionCode).then(function(email) {
var accountEmail = email;
// TODO: Show the reset screen with the user's email and ask the user for
// the new password.
// Save the new password.
auth.confirmPasswordReset(actionCode, newPassword).then(function(resp) {
// Password reset has been confirmed and new password updated.
// TODO: Display a link back to the app, or sign-in the user directly
// if the page belongs to the same domain as the app:
// auth.signInWithEmailAndPassword(accountEmail, newPassword);
// TODO: If a continue URL is available, display a button which on
// click redirects the user back to the app via continueUrl with
// additional state determined from that URL's parameters.
}).catch(function(error) {
// Error occurred during confirmation. The code might have expired or the
// password is too weak.
});
}).catch(function(error) {
// Invalid or expired action code. Ask user to try to reset the password
// again.
});
}
Используя вышеуказанную функцию handleResetPassword
, я могу получить электронное письмо с auth.verifyPasswordResetCode
и как перейти к auth.confirmPasswordReset
с новым паролем? Нужна ли мне HTML-форма? тогда каковы будут действия этой формы? Я смущаюсь, чтобы продолжать auth.confirmPasswordReset
.