trying to use user preferences
AppwriteException: User (role: guests) missing scope (account)
at Client.eval (webpack-internal:///(rsc)/./node_modules/appwrite/dist/esm/sdk.js:455:27)
at Generator.next (<anonymous>)
at fulfilled (webpack-internal:///(rsc)/./node_modules/appwrite/dist/esm/sdk.js:46:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 401,
type: 'general_unauthorized_scope',
response: {
message: 'User (role: guests) missing scope (account)',
code: 401,
type: 'general_unauthorized_scope',
version: '1.5.10'
}
}```
```ts
async function GetCurrentChat() {
try {
const res = await AppwriteUser.getPrefs();
return res?.['x0-chatID'];
} catch (error: any) {
console.log(error);
return false;
}
}```
the user is authenticated
and it can acces database also it is working fine their
also the current logged in user details were returned
am using OAuth and facing this
the one where i used email otp auth that works fine
every single code is same dude then why this even happens
It's probably a 3rd party cookie problem.
For local development, maybe you can change your browser settings to enable 3rd party cookies.
In production, you'll need to use custom domains
3rd party cookies are allowed
in production am using custom domains
already
uff
Look at the network request in the network logs. Do you see the cookie included in the request?
this is when the page is reloaded
but
this is my code
Recommended threads
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...