Moderator
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
Votes
0
Replies
24
Participants
Unknown
Messages
25
Moderator
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
Rank 1: Thread
Yes it is still showing the same , Is there any other changes I should do ?
Rank 1: Thread
I don't get it , Can you explain a bit more.
Admin
I'm not quite sure this is related. I thought the problem was only with oauth
Moderator
He said he wanted to know how to redirect uses when logged in successfully
Moderator
Basically if accoint.get() doesnt throws an error, that means the user is logged in
Rank 1: Thread
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
Moderator
Account.get() should give you all user data if it logged in successfully
Rank 1: Thread
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
Moderator
Yes
Rank 1: Thread
Then why , account.get() gives me an error , that user "missing scope "
Moderator
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
Moderator
So try again to see if it works now
Admin
Again, I don't think there was any problem with cloud and the create email session API call
Moderator
The error he sent seemed to be similar and prior to fix Christy applied
Rank 2: Process
Could it be possible you're getting the error because you're initializing the appwrite SDK again on the Dashboard page?
Admin
The patch we pushed out only pertained to oauth2 sessions
Admin
Appwrite doesn't have a login route. Are you using server side rendering?
Rank 1: Thread
Ok, let me check this ,might it solve the issue
Rank 1: Thread
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
Admin
im not sure what you mean. is the createEmailSession() code being executed server side?
Rank 1: Thread
Yes it is
Admin
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
Rank 1: Thread
So should I need to migrate createEmaillsession () method to front end ?
Admin
Ya, easiest thing to do is to not use server side code/rendering