supabase-go
supabase-go copied to clipboard
How to update user password if the user is not loged in ?
I want to add a forgot password functionality to my web app. I can send a password recovery link to user but in order to update user I need user token.
With GO + TEMPL + HTMX something like this worked for me
With another combo, you could have a front end router, and have a redirect or two less.
I have above working, but with couple of tiny changes to supabase-go library, to support redirect_to parameter, and return the underlying errors.
Thanks for the reply, my problem was with Auth.UpdatePassword function. I wrote a js script to fetch access token from the url and write it into a hidden input field. Then I could fetch the token after post request but when I try to change the password UpdatePassword throw error as empty string so that I couldn't figure out what the problem was. I solved the problem by sending request to supabase directly. I think UpdatePassword function should return readable errors.
Glad to hear you solved it.