Setup: I have a LoggedInGuard
(injected with AuthService
). In AuthService's constructor I've subscribed to http.get to set this.loggedIn = true
based on the response from server.
Question: When user is already logged in (another tab or some other time in past) and directly lands on a route (which is LoggedInGuard
guarded) by the time http.get
completes, LoggedInGuard
checks on the this.loggedIn and assumes user is not logged in. How to block the guard until http.get completes ?