Web Developer
I m encoutering an error from long time and I tried to fixed but nothing seems to work.
So I m trying to make a Google sign in / Login option in my locally hosted website,
I did this
import { account } from "@/Appwrite/Appwrite_config";
const google_auth =async () => {
try {
await account.createOAuth2Session("google", "http://localhost:3000/", "http://localhost:3000/
}catch(err){
console.log(err)
}
};
then I click and sign with my Google account everything work and I find myself in the Auth / users section, but whenever I ties to get that user info or the session info it comes with this error
Unhandled Runtime Error
AppwriteException: User (role: guests) missing scope (account)
[Profil].jsx:
GET https://cloud.appwrite.io/v1/account 401 (Unauthorized)
Btw this is how I did to get the info in [profil].jsx
const getAccount = async () => {
const accountData = await account.get();
console.log("rrrrrrrrrrrrrrrrr",accountData);
};
useEffect(() => {
getAccount();
}, []);
Please what's is the problem ?