AbhishekOriginal post
Rank 2: Process
I am using this method as stated in the docs - https://appwrite.io/docs/products/auth/oauth2#profile
But, if I console log the session, it just gives me session provider as email, and not google. I am also not seeing any data related profile name, email, image, etc. I don't see anything related to google in it.
Here's my function for auth as well -
const authGoogle = () => {
try {
account.createOAuth2Session({
provider: OAuthProvider.Google,
success: "http://localhost:3000/verify",
failure: "http://localhost:3000/",
scopes: ["openid", "profile", "email"],
});
} catch (error) {
console.error("Error during Google OAuth:", error);
}
};
What am I missing here?
Summary
The user is having trouble fetching the profile image from Google login using the Appwrite SDK. The issue seems to be that the session provider is showing as `email` instead of `google` and there is no data related to the Google profile (name, email, image, etc.) in the session.
**Solution:** The problem might be with how the OAuth session is being created. Make sure to check if the correct scopes are provided and if the OAuth provider is set up correctly in the Appwrite dashboard.