Back

Appwrite delete user session (logout) error

  • 0
  • Users
  • Flutter
  • Accounts
kapilprithviraj
28 Jul, 2023, 09:04

I am using appwrite for user authentication in my flutter app, but there seems to be an issue while logging out.

Error message: "AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401)"

This error only appears when I try to log out with a newly created user. When I login and then try to logout, the logout function works fine.

TL;DR
Issue: When trying to log out a newly created user using the Appwrite authentication system in a Flutter app, an error message "AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401)" is displayed. However, logging out works fine for users who have already logged in before. Solution: The issue can be resolved by wrapping the logout function in a `try/catch` block.
Binyamin
28 Jul, 2023, 13:57

That sound like what should be When you try tu run the deleteSession with no user logged in it will throw an error.

Binyamin
28 Jul, 2023, 13:57

What you can do is to wrap it in try/catch

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