I am getting this error even after the user is logged In
https://cloud.appwrite.io/v1/account 401 (Unauthorized)
TypeScript
try {
const userData = await account.get();
setUser(userData);
console.log("USERDATAAAAAAAAAAA", userData);
if (userData) {
router.replace("/");
window.location.reload();
}
setLoading(false);
} catch (error) {
console.log(error);
setLoading(false);
}
};
The above function was to check and fetch userData (User Is already signed In till here)
Below is my appwriteConfgi code
TypeScript
const client = new sdk.Client()
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject("ProjectId")
.setKey(
"apiKey"
);
export const account = new sdk.Account(client);
export const users = new sdk.Users(client);
export const storage = new sdk.Storage(client);
export const databases = new sdk.Databases(client);
(Have removed APi key and projectId as of now for posting)
TL;DR
Developers are encountering an AppwriteException: User (role: guests) missing scope (account) error despite successful user login. The issue persists even after the user is logged in. The error message appears as a 401 (Unauthorized) on the Appwrite Cloud platform. The checkUserStatus function is successfully fetching user data, indicating a successful sign-in, and then the user is directed to the main page. However, the error occurs during this process.
The appwriteConfig code snippet is provided for context, with API key and Project ID removed for the post. The developers are using the provided code for user authentication and fetching user dataTypeScript
const result = await account.createEmailPasswordSession(
email, // email
password // password
);
return result;
};```
This is what i am using to log in the user
Recommended threads
- Problem with email links
Hi. I'm receiving emails without working links, the text that is suposed to be a link is plain text...
- Issue with downloading large files (40GB...
Hi everyone! I am using the latest Appwrite 1.8.0 version on my self-hosted server. I successfully uploaded a large ZIP archive (~40GB) using the chunked uploa...
- Cant get realtime working
Hey I nned some help with realtime a gain. I was using client.subscribe(...), and i found out that its depricated then i believe realtime.subscribe(...) is the ...