title: Angular Universal - Auth Guard pending problem
body: <p>I'm using popup login with Angular Material, when I added Angular Universal the auth guard is the problem.
  If some route is protected by auth guard the page just start pending and never finishes. Behavior without Angular Universal is when page is reloaded It just open up popup for login.</p>
  <pre><code>@Injectable()
  export class AuthGuard implements CanActivate {
    constructor(readonly auth: AuthService, public router: Router, private dialog: MatDialog, private store: Store&lt;fromAuth.State&gt;) {}
  
      /** Performs the user authentication prompting the user when neeed or resolving to the current authenticated user otherwise */
  
      public authenticate(action: loginAction = 'signIn') {
        return this.store.pipe(
          select(fromAuth.selectAuthState),
          take(1),
          switchMap(user =&gt; !user.user ? this.prompt(action) : of(user.user))
        ).toPromise();
      }
  
    public prompt(data: loginAction = 'signIn'): Promise&lt;any&gt; {
  
      return this.dialog.open&lt;LogInComponent, loginAction&gt;(LogInComponent, { data }).afterClosed().toPromise();
    }
  
    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
      // Gets the authorization mode when specified
      // const mode = route.queryParamMap.get('authMode') || 'signIn';
      // Prompts the user for authentication
       return this.authenticate()
        .then(user =&gt; !!user);
    }
  }
  
  </code></pre>
  <p>If I'm directly accessing ngrx store inside canActivate It's working but I want to work with .toPromise()</p>
  <p>I'm using httponly cookies and on every reload Angular is sending http request to nodejs db to fetch user data. On every other route It's working as expected.</p>