Hi, I'm trying to pass v-model on the input to try to send the email to reset the validation, but I don't know how to pass it correctly from the input to sendPasswordResetEmail. This is what I have so far
methods:{ resetPassword(){ const auth = app.auth(); const userEmail = ref('') auth.sendPasswordResetEmail(userEmail.value).catch((error) => { console.log(error); }); alert('Reset email has been sent') console.log(userEmail) }, },
This is the input part
<form v-if="reset" @submit.prevent="resetPassword"> <input type="email" required placeholder="email" v-model="userEmail" class="inline-block"> <button>Reset Password</button> </form>
I've also been trying to return userEmail, but nothing seems to work.
P粉7318612412024-04-06 00:35:28
Check if you are getting user email value in resetPassword()
function. If not, then the problem is with the reference.
Correct this line,
const userEmail = ref('')
If you use values from HTML v-model, you must use the this keyword.