title: Angular Oauth2 OIDC - How to check if user is logged in?
body: <p>I am using Angular 11 with version 10 of augular-oauth-oidc</p>
  <p>Is this the correct way to check whether the user is currently logged in?</p>
  <pre><code>@Injectable({
    providedIn: 'root'
  })
  export class AuthService {
    constructor(
      private oauthService: OAuthService,
      private router: Router,
    ) {
  
   .
   .
   .
  
    isLoggedIn(): boolean {
      const identityClaim = this.oauthService.getIdentityClaims();
      return identityClaim &amp;&amp; identityClaim['name'] ? true : false;
    }
  
  </code></pre>
  <p>I feel this is hacky... I am just checking whether the name field exists within identity?</p>
  <p>How does this prevent a user from just modifying this variable in his console - apart from server sided checks upon api submission or something.</p>
  <p>Does Angular route guard and interceptor do this job?</p>
  <p>Thanks!</p>