phoneNumber signUp & signIn #105

Closed
opened 2026-03-13 07:33:40 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @amirhd-com on GitHub (Oct 19, 2024).

Describe the bug
When I sendOTP and verify the user phoneNumber on signUp flow works successfully, but the issue is so the user want signIn with what?!!!! on the database just create a row with temp email without any password set by user before! there is no any account. (see pictures).
on the other hand, I want the user on the signUp flow, after sent and verify it's phoneNumber, can set password with username or email or ... depend on that phonenumber; and don't create any new row in user table on database.
And when user want login in the signIn flow, can use username & password or email & password or phoneNumber & password too. (and passkey plugin work on depend with all these, that can configure on auth file for example) and could set true or false all signIn type must only work on verified phoneNumber or email or ... or multiple conditions.

Expected behavior
even can't have session on browser when sent & verify poneNumber on signUp, and use client.user.setPassword get error.

Screenshots
image
image
image

Originally created by @amirhd-com on GitHub (Oct 19, 2024). **Describe the bug** When I sendOTP and verify the user phoneNumber on signUp flow works successfully, but the issue is so the user want signIn with what?!!!! on the database just create a row with temp email without any password set by user before! there is no any account. (see pictures). on the other hand, I want the user on the signUp flow, after sent and verify it's phoneNumber, can set password with username or email or ... **depend on that phonenumber**; and don't create any new row in user table on database. And when user want login in the signIn flow, can use username & password or email & password or phoneNumber & password too. (and passkey plugin work on depend with all these, that can configure on auth file for example) and could set true or false all signIn type must only work on verified phoneNumber or email or ... or multiple conditions. **Expected behavior** even can't have session on browser when sent & verify poneNumber on signUp, and use client.user.setPassword get error. **Screenshots** ![image](https://github.com/user-attachments/assets/14da42e3-c240-4cc2-8560-ff3a9c52c4e3) ![image](https://github.com/user-attachments/assets/099b6c25-7854-4ae8-a960-c377cb7fff2a) ![image](https://github.com/user-attachments/assets/b780770e-744d-4ab6-aa65-cbcf8639c7ef)
GiteaMirror added the bug label 2026-03-13 07:33:40 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 20, 2024):

So the flow is supposed to works with phone auth using send-verify. When a user wants to sign in, you send them an OTP, they verify it, and a session is generated.

If you need them to set a password and log in with credentials instead, you'll need to create a credential-based account using setPassword method once they've already authenticated using their phone number.

@Bekacru commented on GitHub (Oct 20, 2024): So the flow is supposed to works with phone auth using send-verify. When a user wants to sign in, you send them an OTP, they verify it, and a session is generated. If you need them to set a password and log in with credentials instead, you'll need to create a credential-based account using `setPassword` method once they've already authenticated using their phone number.
Author
Owner

@amirhd-com commented on GitHub (Oct 20, 2024):

so how? how can user signUp with phoneNumber then setPassword with uername or email? there is no session before sign In to access user.setPassword!! and for signIn must have an account, but when verify phoneNumber in first step of sign up flow, can't update and setPassword and username or email.

image
image
👆🏻👆🏻👆🏻as you see, when sentOTP and verify phoneNumber on SignUp, create these row on database. so how update email & username for example in these tables still user can't signIn?!!! and set password still not any account create for this user on account table?!!!

@amirhd-com commented on GitHub (Oct 20, 2024): so how? how can user signUp with phoneNumber then setPassword with uername or email? there is no session before sign In to access user.setPassword!! and for signIn must have an account, but when verify phoneNumber in first step of sign up flow, can't update and setPassword and username or email. ![image](https://github.com/user-attachments/assets/ac6fc24f-f9b7-4d07-a72a-2178bab5fc06) ![image](https://github.com/user-attachments/assets/a9a3a76f-89a6-4c61-b157-13db44b58ce5) 👆🏻👆🏻👆🏻as you see, when sentOTP and verify phoneNumber on SignUp, create these row on database. so how update email & username for example in these tables still user can't signIn?!!! and set password still not any account create for this user on account table?!!!
Author
Owner

@amirhd-com commented on GitHub (Oct 20, 2024):

advanced: {
useSecureCookies: true,
},
attention to this feature

@amirhd-com commented on GitHub (Oct 20, 2024): advanced: { useSecureCookies: true, }, attention to this feature
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#105