want to make user loggedin for long time how can i implement it?
- 0
- Web
- Android
- Accounts
- Apple
- Users
first two images are for login
i used it signed up and logged into home screen after exiting app i am again redirected to login page i should login again and again..... how can i handle this problem how to make user to stay logged in for long time?
What I usually do is have a block of code in the login/signup page (whichever is your default), that first checks whether the user has an active session.
If they have an active session, redirect them to the suitable page. If they don't have a session, stay on the page and ask them to login/signup
a simple way to do this is to use account.get()
ohh okay
Essentially, if the user has an active session, account.get() will return a response. If there is no session, you will get an AppwriteException, that you can catch.
@Ahmed if you have any other questions in this particular topic, please tag me and ask away! For questions on a different issue, please make a new post 😄
Let me know how it goes!
why new post @safwan ?🥲
i'll ask question itself here.
no like, if you have question about a different issue, make a new post.
ohh okay boss
if it's the same issue, feel free to ask here!
can we use asyncStore with it
?
Hey sorry for the late reply just saw this message.
asyncStorage is used for persisting data on the device. What do you want to store on the device when a user logs in?
@Ahmed
Recommended threads
- Problem with Google Workspace at DNS Rec...
Hello, I bought a domain at Namecheap, and Google Workspace used to work there, but now that I switched from Custom DNS to Appwrite's nameservers, it doesn't w...
- change role of a team member in Appwrite
It's not possible to add/change roles of a team meber in Appwrite Frontend. When you click on a member of a team you get forwarded to the configuration page of ...
- Deeplinking/hosting apple-app-site-assoc...
I'm trying to implement deeplinking so that after a user logs in, they are redirected to the place in my app I want them to go. As far as I understand, I need a...