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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...