Hello everyone, I want in my app. (AppGyver) make ...
# help
y
Hello everyone, I want in my app. (AppGyver) make a self-service in which the user can change his password. I can't find a tutorial where I can change my password with Postman, for example. How should I do that? Thanks very much Jens
n
Hello @Yänz! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
c
If you need the a REST API, take a look at this: https://github.com/supabase/gotrue#put-user
n
Yänz (2022-03-13)
c
If you need to do it from JS, you can use: SupabaseClient.auth.update({password: YOUR_NEW_PASSWORD})
of course, both methods require authentication (i.e. the user making them MUST either be the service role or the owner of the user record)
y
Yes I tried the REST one, like: PUT https://some-url.supabase.co/auth/v1/users?email=eq.test@test.com but I get a 404 Error.
And the Body is [{"email":"test@test.com", "password": "NEWPASSWORD"}]
c
It seems that there are 2 issues with your request: - the path should be just https://some-url.supabase.co/auth/v1/users (i.e. don'e include a query param) - your body should NOT be an array - it should be a single JSON object Also, if you are NOT trying to change the e-mail (I am not actually sure if that is supported), you don't need to include the e-mail anywhere in the request - the record whose password will be reset is identified by the authorization of the request
my guess is that you are getting 404 because of the query param (if the issue was the payload you should have gotten 400 bad request, but who knows...)
r
Yanz have you sorted this one out?
y
@Robert Silva Hello Robert, hadn't noticed that you had asked. To be honest, I pushed the topic aside and pushed it away from me. But it's still a to-do and now wants to tackle it again. So: Question 1) is it even possible for a user to change their password (I assume) Question 2) If so, how if I cannot send the new password in the body. Let's get started, I'm happy Jens