0đź‘Ť
Okay y’all, this is the solution I came with:
There’s no way to know if an user will ve logged in until it gets actually logged in and the authStateChange event fires. So the best I could do is, when the user logs in into the application, I store a “EXPECT_LOGIN” value in localStorage, so if I reload the app, and that value it’s true i show a “Loggin in” message with a timeout of, say, 5 seconds. Here we have two possibilities:
- The event is fired and the user is logged in automatically
- The timeout is fulfilled and I set the “EXPECT_LOGIN” value to False, then I let the user login manually
Source:stackexchange.com