Password Change Flow (Sveltekit)
# help
y
Password Change Flow (Sveltekit)
n
Hello @Yeehawlerz101! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! 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.
y
I just went through https://discord.com/channels/839993398554656828/977946234260168774 Ianbau had posted about it
I'm trying to do the same thing but my console is saying:
Password update requires reauthentication.
however my account is made via magic link and I'm moving to user/pass
so I dont have any way to login. I figured this could be either my error as I could just re make my account/email
this is the end result code that I'm running to try and update the password
Copy code
js
  const { data, error } = await supabase.auth.api
  .updateUser( access_token, {password: password})
it still tells me to re authenticate myself even when I send myself a magic link via the app dashboard (from supabase)
s
You can use
await supabase.auth.update({ password })
to reset the password, a token isn't required as the user would have been logged in already. You can have a look at how I'm doing this in my project https://github.com/silentworks/waiting-list
n
Yeehawlerz101 (2022-05-30)