Skip to content
Back

[Error: AppwriteException: User (role: guests) missing scope (account)]

  • 0
  • React Native
Paulito
23 Jun, 2025, 12:04

After logging in successfully I am getting this Error. Before I impleamented this helper function:

export async function updateUserPassword(oldPassword, newPassword) { try { const response = await account.updatePassword(newPassword, oldPassword); return response; } catch (error) { console.error("Error updating password:", error); throw new Error(error.message || "Failed to update password."); } }

After testing it the password has changed but I am getting the error in the title after logging in. Can anyone help me out. what may cause this? AI is not helpful

TL;DR
Developers are experiencing an error related to a missing scope for the user role 'guests' when trying to execute account.get(). It seems to be caused by not logging out and ending the session after changing the password. A proposed workaround involves logging out and logging back in with the new password. Additionally, an updateUserPassword helper function is implemented successfully but still causes the error.
Paulito
23 Jun, 2025, 12:06

why is account.get() failing after i changed password?

Paulito
23 Jun, 2025, 12:13

I signed up a new account and got the same error. not sure whats going on

Paulito
23 Jun, 2025, 12:43

I am guessing it has something to do with not logging out and ending the session after the password is changed. now somehow account.get() is using this expired session to get an account and failing? btw i am recoding so that the user is getting logged out and the logged in again with the new password to prevent this from happening. Any help is welcome

Paulito
23 Jun, 2025, 12:52

I have wiped data on emulator and closed all sessions. now everthing (log in and account.get() ) is working . can someone help me understand why this happend and how to prevent it?

Axistro
23 Jun, 2025, 12:53

I think there is something that is logging out the current account else there is no reason for the error

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more