I am following the Task Tracker tutorial and I am not able to persist the login session. I am able to register and login, however, everytime I close the app and open it again, it redirects me to the login screen.
In addition, I use AuthProvider to read user, I get “null”.
Anyone have any ideas? Do I have to write custom logic to persist login information / session tokens?
“user” is a run-time variable only set upon calling the login function, while “currentUser” is persisted. To fix the problem, we have to look at the currentUser object instead of the User object.
In my case, I added a currentUser variable to the AuthProvider that is set upon the initialization of the app.
I’m glad you “self solved” this issue. I will speak with the docs team to make sure the currentUser variable is highlighted as the persistent variable in the docs.