So this is my logic. I will have an authenticate function in my loginViewModel which basically retrieves a user from the database and checks if it matches the input from a textField. I will have another function to log the user out from a different screen, it will cut off its connection with the database.
While that logic is clear in my mind, I don’t have any idea to persist the state if a user is already logged in or not after closing the application. So when opening the app, if the user is already logged in, they should be navigating to the homescreen immediately. Is there any way to achieve this??
Just Me Again is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.