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
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...