
Execute accoun.get() on page load to check if the user has logged in and redirect them. To redirect them after login, you will need to trigger redirect after your console.log

Yes it is still showing the same , Is there any other changes I should do ?

I don't get it , Can you explain a bit more.

I'm not quite sure this is related. I thought the problem was only with oauth

He said he wanted to know how to redirect uses when logged in successfully

Basically if accoint.get() doesnt throws an error, that means the user is logged in

What I mean is , I can redirect easily after login and signin of the user , but I need all the information related to the user created session at my home page which can be obtained by calling account.get() function, here this function gives me error that 'user missing scope '.
Now how to resolve this , this is what I want to know .
@Steven @D5 @KehindeJ

Account.get() should give you all user data if it logged in successfully

Ohk , Can I login successfully by doing account.createEmailSession(),
And If yes , then in my case it might login successfully because I receive a token($Id) from it

Yes

Then why , account.get() gives me an error , that user "missing scope "

Maybe user didn't logged successfully or ther's something wrong with your code. From what you sent, user didn't logged in successfully due to an error in appwrite cloud, now fixed

So try again to see if it works now

Again, I don't think there was any problem with cloud and the create email session API call

The error he sent seemed to be similar and prior to fix Christy applied

Could it be possible you're getting the error because you're initializing the appwrite SDK again on the Dashboard page?

The patch we pushed out only pertained to oauth2 sessions

Appwrite doesn't have a login route. Are you using server side rendering?

Ok, let me check this ,might it solve the issue

I am not rendering through appwrite , I am just trying to get session data for authenticated user by login or sign in , by using account.get() method

im not sure what you mean. is the createEmailSession() code being executed server side?

Yes it is

right...so the session is being created server side...where the cookie doesn't get saved. then your front end loads and doesn't have the session at all

So should I need to migrate createEmaillsession () method to front end ?

Ya, easiest thing to do is to not use server side code/rendering
Recommended threads
- Auth Error
"use client"; import { useEffect } from "react"; import { getSessionCookie } from "@/actions/auth"; import { createBrowserSessionClient } from "@/lib/appwrite-...
- Prevent modifying specific attributes
How do I prevent user to only to be able to modify some of the attributes. Document level security gives full access to update whole document, what are the wor...
- Bypass Error When Creating Account With ...
Suppose user first uses email/pass for log in using xyz@gmail.com, few month later on decides to use google oauth2 with same xyz@gmail.com (or in reverse orde...
