is AppwriteException: User (role: guests) missing scope (account) at l.<anonymous> (https://patiyala.vercel.app/_next/static/chunks/169-669b8aff7908ca0e.js:38:8845) at Generator.next (<anonymous>) at a (https://patiyala.vercel.app/_next/static/chunks/169-669b8aff7908ca0e.js:38:2628) page-568c20c68195f2df.js:1
this error occurs only in vercel and doesnt occur in localhost when the user tries to login via google and is redirected afterlogin. Please help.
@Moderator
Could someone help me. it was working just a moment ago and now it doesnt
{ "message": "User (role: guests) missing scope (account)", "code": 401, "type": "general_unauthorized_scope", "version": "0.12.121" }
sessions are getting created though
SSR support comes with 1.5. Cloud is for now in 1.4
Oh
so what do i do now?
The problem is only with google auth and normal sign up works just fine
Hey could you please help me out and maybe provide me with a tutorial or documentation which implements google auth on next js with appwrite?
const currentSession =async()=>{ try{ const session = await account.get();
console.log(session);
console.log(session.userId);
setLoggedInUser(session)
console.log(session.providerEmail);
}
catch(err){
console.log(err)
}
} this is how i am trying to find the user's account which is logged in. this works just fine on local host but doesnt work on the vercel app
"use client";
Hey thanks a lot, but as i told the normal login does work for me its just that google auth is not
the account and the sessions are getting created its just that on redirect it says that AppwriteException: User (role: guests) missing scope (account) and couldnt get the logged in account info
Please help me out with this one
Do you have added the use client in oauth?
yes
How are you handling the success URL of the oauth2?
So i have a function which will check if the users account is used for the first time and then it is pushed db with the basic info of the user
Hey i am still facing the same issue. Could anyone help me pls?
: (
Using this works.
'use client'; // ESSENTIAL!
import { createWebClient } from '@/api/database/createWebClient';
export async function getWebLoggedInUser() {
const { account } = createWebClient();
try {
return await account.get();
} catch (e) {
return null;
}
}
export function createWebClient() {
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('YOUR_PROJECT');
return {
get account() {
return new Account(client);
}
};
}
export const ID = AID;
What's the browser you're using?
Recommended threads
- My account is blocked so please check an...
My account is blocked so please unblock my account because all the apps are closed due to which it is causing a lot of problems
- Applying free credits on Github Student ...
So this post is kind of related to my old post where i was charged 15usd by mistake. This happens when you are trying to apply free credits you got from somewh...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...