title: Why does my Auth-guard stop without completing the observable code?
body: <p>I have an app that I need to use Auth-Guards in order to perform silent-renew calls to allow them through if they are already logged in to the IdentityServer project that is providing my authentication, through any of our other apps. Basically, we want to have a seamless login flow between applications.</p>
  <p>Currently, the way I am handling that or trying to anyway is to have an auth guard on every page, and for certain pages that don't require authentication, but could use it to handle roles requests to the server, I would check it, perform a silent renew just in case, and then get the roles if they were authenticated, and still return true if not.</p>
  <p>I have broken this into a test auth-guard, removed the roles bits, and tried to figure out the best approach to get this to work.  Currently, there seems to be an issue where the auth guard never completes the process inside the observable if I AM logged in to IdentityServer, but not the client application.</p>
  <p>Here is the code:</p>
  <p>AuthGuard:</p>
  <pre><code>canActivate(
      route: ActivatedRouteSnapshot,
      state: RouterStateSnapshot,
    ): Observable&lt;boolean&gt; | Promise&lt;boolean | UrlTree&gt; | boolean {
      this.spinner.start();//this blocks the screen until it is done, it is what told me that nothing 
      //else was getting hit
      return this.oidcAuthService.isUserLoggedIn.pipe(
        delay(1000),
        map(loggedIn =&gt; {
          if (!loggedIn) {
            this.oidcAuthService.renewToken().then(user =&gt; {
              if (user &amp;&amp; !user.expired) {
                return true;
              } else {
                return this.accessDenied();
              }
            }).catch(error =&gt; {
              if (error instanceof HttpErrorResponse) {
                if (error.message === 'login_required') {
                  return this.accessDenied();
                }
                return this.accessDenied();
              }
            })
          } else {
            return true;
          }
        }),
      );
  }  
  
  private accessDenied() {
      window.alert(&quot;You don't have permission to view this page&quot;);
  
      this.router.navigate(['/']);
  
      return false;
    }
  </code></pre>
  <p>...</p>
  <p>OidcAuthService:</p>
  <pre><code>  get isUserLoggedIn() {
      return this._isUserLoggedIn.asObservable();
    }
  </code></pre>
  <p>The issue is that I cannot seem to get the code inside the isUserLogged check to run if the client is not logged in and the Server is.</p>