You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Bug Report: Error 500 using updateEmail when password is not set cause OAuth2 #4975
try to update the email or phone using the updateEmail or updatePhone endpoint
👍 Expected behavior
Update the email or phone without ask for a password, or use other method to confirm the changes
👎 Actual Behavior
We get an error
Unhandled Runtime Error
AppwriteException: Server Error
I have test it with updateEmail and updatePhone but this should happen in any endpoint who requires a password
the container logs shows the following error:
[Error] Method: PATCH
[Error] URL: /v1/account/phone
[Error] Type: TypeError
[Error] Message: Appwrite\Auth\Auth::passwordVerify(): Argument #2 ($hash) must be of type string, null given, called in /usr/src/code/app/controllers/api/account.php on line 1569
[Error] File: /usr/src/code/src/Appwrite/Auth/Auth.php
[Error] Line: 216
🎲 Appwrite version
Version 1.2.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
I didn't realize, this is caused for a different reason in my case; the user is using an OAuth2 authentication that is why there is not password set.
Isn't possible to this happen with email and password authentication as, for use any of that endpoint first you need to have an active session and as the user haven't a password, the session can't be created
I think this problem can happen with any other password less authentication method when the user doesn't have set a password
changed the title [-]🐛 Bug Report: Error 500 using `updateEmail|updatePhone` when password is not set[/-][+]🐛 Bug Report: Error 500 using `updateEmail` when password is not set cause OAuth2[/+]on Jan 10, 2023
Activity
AkashSharma001 commentedon Jan 9, 2023
I would like to work on this. @stnguyen90
harshmange44 commentedon Jan 9, 2023
Hey, I would like to fix this @gepd @stnguyen90
stnguyen90 commentedon Jan 10, 2023
@gepd, would you please provide the docker logs for the appwrite container related to this error?
gepd commentedon Jan 10, 2023
Sure! @stnguyen90 I have updated the issue with the info
stnguyen90 commentedon Jan 10, 2023
@gepd thanks! let me check with the team to see how we want Appwrite to behave for this.
gepd commentedon Jan 10, 2023
I didn't realize, this is caused for a different reason in my case; the user is using an OAuth2 authentication that is why there is not password set.
Isn't possible to this happen with email and password authentication as, for use any of that endpoint first you need to have an active session and as the user haven't a password, the session can't be created
I think this problem can happen with any other password less authentication method when the user doesn't have set a password
[-]🐛 Bug Report: Error 500 using `updateEmail|updatePhone` when password is not set[/-][+]🐛 Bug Report: Error 500 using `updateEmail` when password is not set cause OAuth2[/+]gepd commentedon Jan 17, 2023
@stnguyen90 did you get any answer from the team?
stnguyen90 commentedon Feb 23, 2023
@gepd, sorry I missed this! we discussed this internally, and we have decided we:
stnguyen90 commentedon Feb 23, 2023
Possibly related: #4990
gepd commentedon Feb 24, 2023
To do this, we should skip the validation in this 3 endpoints
appwrite/app/controllers/api/account.php
Line 1561 in 8b7dd6e
appwrite/app/controllers/api/account.php
Line 1661 in 8b7dd6e
appwrite/app/controllers/api/account.php
Line 1605 in 8b7dd6e
I can send a PR to fix this, what do you think?
stnguyen90 commentedon Mar 1, 2023
@gepd, assigned!