
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
- Sharing cookies
Hi, I’m using Appwrite Cloud, and I have a setup where my Appwrite backend is hosted on a subdomain (e.g., api.example.com), while my frontend (Next.js app) and...
- Organization not exists anymore
Hello! We have a problem with a cloud database. We are on the Free plan, but after a refresh the site wants me to create a new organisation, and I not see the c...
- JSON and Object Support in Collection do...
I am working with Next.Js and Appwrite Cloud, I am relatively New to Appwrite but i have noticed there is no direct support of JSON and Object support in attrib...
