when using createEmailPasswordSession const session = await account.createEmailPasswordSession(email, password) i am able to get the session but when using const session = await account.createOAuth2Session( OAuthProvider.Google, 'http://localhost:3000/', 'http://localhost:3000/logiin/', )
not getting any session
full code auth.ts ||https://codefile.io/f/i2BRsKgbw0
I don't believe the oauth method returns any session informaiton, it redirects you to your success/failure url. If you want to check session you can do account.getSession('current');
If you look in the docs for this method, it tells you the response.
https://appwrite.io/docs/references/cloud/client-web/account#createOAuth2Session
Here it shows there is no object response but instead a 301 redirect response. Redirecting to your defined success or failure url.
How can i show the user avatar, user name etc information for user profile
do i have to use this const session = await account.getSession("current")
Sure, sounds like you probably need to read over the oauth information in the documentation.
Recommended threads
- CORS preflight returns 500 on Dart funct...
Hey everyone 👋 I’m running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: ```NoSu...
- Auto Updating Backend & Auth via Appwrit...
<@870607367597850624> Hey everyone 👋 I wanted to ask to ask for a friend, he’s asking if Appwrite be used in a similar way to Supabase when integrated with AI ...
- execution failed
When executing an appwrite function, I'm getting a 500 error, but I don't see it in executions. This issue appeared today. Here's the appwrite function ID: 68b4...