Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update user password if the user is not loged in ? #53

Open
geoport opened this issue Apr 15, 2024 · 3 comments
Open

How to update user password if the user is not loged in ? #53

geoport opened this issue Apr 15, 2024 · 3 comments

Comments

@geoport
Copy link

geoport commented Apr 15, 2024

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.

@emilkm
Copy link

emilkm commented Apr 16, 2024

With GO + TEMPL + HTMX something like this worked for me

image

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.

@geoport
Copy link
Author

geoport commented Apr 16, 2024

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.

@emilkm
Copy link

emilkm commented Apr 16, 2024

Glad to hear you solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants