I have some questions related to Auth in Android(Kotlin) Jetpack Compose.
1:- How can I know with Account.Get() that if a user is already logged in or need to login? So that I can show the main content or Login Screen.
2:- Is Accoount.Get() always returns updated value? I mean if I change the name of a authenticated user from server, will it be immediately updated to the user device? If no, then how can I achieve this?
- If account.get() throws an error, specifically missing scope account... That means the user is not logged in.
The most optimal approach is probably saving locally some value so the user is redirected to the login screen immediately at least first time, and then once logged in, redirect it to home screen, saving you bandwith usage and unnecesary checks. Then if there is some error, check if it's due to not having a valid session (you run account.get then)
- Yes, it fetches the session from the server so consequently the data will always be updated.
Recommended threads
- What's the proper way to delete user acc...
I would like to provide an option for the users of my app, to completely remove theirs account if they want to. I don't want to 'deactivate' the account, but to...
- Project Inactivity Clarification
I'm on appwrite free plan with my account (om.thakkar@ivcventure.com). Even though throughout the week we use the project atleast once to upload dynamic content...
- Free trial credit?
I understand that another person I know got a free 50 dollar credit promo as a banner in his project but I fail to see one in mine. Is such promo not for everyo...