π Bug Report: got the error message in docker logs: (role: applications) missing scope (account)
luokelong opened this issue Β· comments
π Reproduction steps
When I request appwrite.account.updatePrefs api I got the error message in docker logs:
[Error] Method: PATCH
[Error] URL: /v1/account/prefs
[Error] Type: Appwrite\Extend\Exception
[Error] Message: app.642114447fa9bd772401@service.appwrite.mydomain.com (role: applications) missing scope (account)
[Error] File: /usr/src/code/app/controllers/general.php
[Error] Line: 365
I am sure that my API key has been set correctly.
appwrite version is: 1.2.1
web sdk version is:
"appwrite": "^10.2.0",
node sdk version is:
"node-appwrite": "^8.2.0",
I am sure that I have set the permissions for the API key correctly.
users.read: checked
users.write: checked
Hi, are your Appwrite API and web applicatio using the same top level domain? Just to confirm and have a look at it.
Apologize...
I mistakenly used the appwrite.account.updatePrefs api NOT the appwrite.users.updatePrefs api (with userId) to update user's prefs.
When permissions comes from the appwrite.client.setKey NOT the appwrite.client.setJWT I should use the latter.
appwrite.client.setKey for appwrite.users.updatePrefs with userId
appwrite.client.setJWT for appwrite.account.updatePrefs without userId
Thank you all.