Justine
05/19/2023, 1:37 PMemailDelivery
on the backend, from the input I can get the passwordResetLink
and from there I can extract the token
from the URL params.
{
type: 'PASSWORD_RESET',
user: {
email: 'abc@gmail.com',
id: '83cb2c80-c119-4bbe-b191-4c1ab67a950c',
timeJoined: 1684502523294
},
passwordResetLink: 'http://localhost:3000/auth/reset-password?token=MTBjNzQwYThkZDdhZjk0YTUyODEzMGQ1YzZhM2NlY2E5ODkxNzQxNTM5M2M1ZmI0OGQ1OWJkMTIwYzBkODU5NjEzOWFiNzkxMjMyYjk3OTg0ZmMxYzZiMDY3MzQ5ODli&rid=emailpassword',
userContext: { _default: { request: [FastifyRequest] } }
}
Now from the frontend, after I get the token from the URL, and after the user provides the new password, I should use the submitNewPassword
function to send the new password along with the token yes? But on the frontend I see that the types do not match what I see in the documentation. I know this document might be old, so I'm wondering if there's a new way of doing it, maybe including the token in the FormFields
array?rp_st
05/19/2023, 2:52 PMrp_st
05/19/2023, 2:52 PMlet response = await submitNewPassword({
formFields: [{
id: "password",
value: newPassword
}]
});
rp_st
05/19/2023, 2:53 PMhttps://cdn.discordapp.com/attachments/1109112641059823626/1109131693354401872/Screenshot_2023-05-19_at_20.23.13.png▾
rp_st
05/19/2023, 2:53 PMJustine
05/20/2023, 7:28 AMJustine
05/20/2023, 7:32 AMsubmitNewPassword
function will automatically take the token
from the URL param and pass to the API for verification and updating the password?rp_st
05/20/2023, 7:33 AMJustine
05/20/2023, 7:38 AM