I asked about this last year too – here’s the link:
That seems to work on my app. I don’t encounter flashes of the login screen when not needed. Possibly it has something to do with the front end framework I’m using (React).
Would it be possible to check if userId, isLoggedIn, loggingIn are null false false, and if so skip the login screen until they are all filled in with their final values?