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 ?
Please use a clear summary in the title to make it easier for people to quickly understand your problem and search for it if they face the same problem
Also, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting
You're probably running into a problem with 3rd party cookies. You can search around for discord for similar questions.
In short, you can try to enable 3rd party cookies. You can try to enable 3rd party cookies to test.
In production, you'll need a custom domain: https://appwrite.io/docs/custom-domains
Still unauthenticated after successful oauth flow
Best support ever seen 🙏
Recommended threads
- Free plan Usage
I using a free plan with one organization. I have three projects but on the free plan I should be able to have 2 projects running But in my case only 1 out of ...
- SPA Not working
So I'm using vite/react, which is spa, and it used to work before, but now whenever I go to any route except the root it shows appwrites 404 page, instead of us...
- Get Started - Web is broken
Trying to complete the get started tasks since the "66%" was finally getting to me, and clicked on "web", was met with: ``` Uncaught TypeError: Cannot read prop...