Reset Password

im on making a reset password with temporary password flow But dont know where to put this function in order to set user password const token = new URLSearchParams(window.location.search).get("token"); if (!token) { // Handle the error } const { data, error } = await authClient.resetPassword({ newPassword: "password1234", token, });
No description
No description
1 Reply
bekacru
bekacru4d ago
so when you call forgetPassword you can pass redirectTo as a callback url. When the user presses the link from their inbox they'll be redirect to this url with token appeneded where you'll be able to as for a new password and reset it using the one time token if you don't provide the redirect to, when you send the email you have the token in the sendResetPassword callback which you can use to construct custom endpoint and call reset password later on

Did you find this page helpful?