I want to get the current user with account.get after an OAuth login like Google but I always GET https://cloud.appwrite.io/v1/account 401 (Unauthorized) User (role: guests) missing scopes (["account"]). I can't find a way to fix it. Can someone help me? Many thanks! FYI: everything works when logging in with email and password
Can you please share your OAuth setup? And more details of your console error?
This is the OAuth function: ```async OAuth() {
try {
return await account.createOAuth2Session({
provider: OAuthProvider.Google,
success: ${process.env.NEXT_PUBLIC_WEBSITE_URL}/dashboard,
failure: ${process.env.NEXT_PUBLIC_WEBSITE_URL}/
});
} catch (error:any) {
throw(error)
}
}```
The console error is nothing more than this: GET https://cloud.appwrite.io/v1/account 401 (Unauthorized) with AppwriteException: User (role: guests) missing scopes (["account"]).
Do you have your client initialized? Like this: const client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT)
.setSession("current");
Recommended threads
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...
- Email address must be in its canonical f...
Hello, Recently I was trying to signup with my GitHub account with appwrite account for availing the student benifits but while trying to signup I saw such erro...
- Login / Signup issue
So I have been trying to create an account on appwrite but no matter what I try it doesn't work. I tried using GitHub at first but after logging in it just red...