sockenguy
02/05/2022, 12:11 PMtype=recovery
fragment in my supabase reset password logic?
https://supabase.com/docs/reference/javascript/auth-api-resetpasswordforemail#notes
I am using nextjs, any ideas and tipps are appreciatedsilentworks
02/05/2022, 12:13 PMsockenguy
02/05/2022, 12:15 PMsockenguy
02/05/2022, 12:15 PMsilentworks
02/05/2022, 12:15 PMsilentworks
02/05/2022, 12:15 PMsockenguy
02/05/2022, 12:16 PMsilentworks
02/05/2022, 12:24 PMresetPasswordFromEmail
. My url looks something like http://myappurl.com/logging-in?redirect=/account/password-update
The reset password takes a option parameter after the email
js
supabase.auth.api.resetPasswordForEmail('hello@example.com', { redirectTo: 'http://myappurl.com/logging-in?redirect=/account/password-update' })
Once the use click the link in the email, I will then check in my app code for the redirect
query param and redirect to that page, that page contains a form and I use the .update
method to update the password.
js
await supabase.auth.update({ password: new_password })
sockenguy
02/05/2022, 12:31 PMsockenguy
02/05/2022, 12:31 PMsockenguy
02/05/2022, 12:57 PMredirect
query params? Do you check it in an useEffect?sockenguy
02/05/2022, 2:25 PMsockenguy
02/05/2022, 2:25 PM