Back

Appwrite general_unauthorized_scope error in nodejs SDK

  • 0
  • Auth
DRLV
18 Sep, 2024, 03:48

help me to fix this error. I use appwrite phone number authentication. after creating session with id and secret when I try to get user the I got this error

TL;DR
Developers are facing a "general_unauthorized_scope" error in the node.js SDK when calling the userAccount method in Appwrite. The issue may be due to using an API key with incompatible account methods. The solution is to recreate the key without the sensitive code.
D5
18 Sep, 2024, 11:58

Hello! Do you can give us more context like the code giving the error or stack you're using?

DRLV
19 Sep, 2024, 02:37

here is the index.js file

DRLV
19 Sep, 2024, 02:38

registerUser and createSession method work well but when I run userAccount method then I got this error

Steven
19 Sep, 2024, 02:48

Deleting code that has sensitive API key. You should recreate the key

Steven
19 Sep, 2024, 02:49

You're using an API key with account methods which are not compatible

DRLV
19 Sep, 2024, 03:31

ok, how I can I fix this

Steven
19 Sep, 2024, 13:53

What's your stack?

Tjpin
19 Sep, 2024, 14:22

facing same problem here when getting current user. Unhandled Exception: AppwriteException: general_unauthorized_scope, app.apidxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@service.cloud.appwrite.io (role: applications) missing scope (account) (401) . ihave all scopes enabled.

Steven
19 Sep, 2024, 14:25

Also, if you need help please create a separate support post with your details

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