supabase / auth

A JWT based API for managing users and issuing JWT tokens
https://supabase.com/docs/guides/auth
MIT License
1.32k stars 330 forks source link

Password reset for accounts using OTP (phone number as usernames) #1053

Closed alexreyes closed 11 months ago

alexreyes commented 1 year ago

Bug report

There doesn't seem to be a way to reset passwords for accounts made using phone number (OTP) based log in.

Describe the bug

See above

To Reproduce

  1. Create an account using phone number (OTP) auth
  2. Try to reset the password

Expected behavior

Password reset works with phone number based auth (i.e. situations where we don't have the user's email)

Additional context

This is quite vital for mobile apps

hf commented 1 year ago

Hi @alexreyes, I'm not sure I understand the problem. OTP based login is a passwordless login method. There is no password stored for the user. Each time a person needs to log in, a new, random and unguessable password is generated (thus called One Time Password) and sent to their SMS.

Forgot password does not apply in this case.

alexreyes commented 1 year ago

@hf My bad, what I meant is: password reset is needed for accounts which use a phone number as the username. As in, accounts made with phone numbers (no email).

Currently password reset is only supported for email based accounts

kangmingtay commented 11 months ago

I don't think we'll be fixing this because a password reset for an account created using a phone number - supabase.auth.signUp({ phone: "...", password: "..."}) can be reset by calling supabase.auth.signInWithOtp({phone: "..."})) to get an OTP first, then calling supabase.auth.updateUser({password: "newpassword"})