I try to hide a div when the user is logged in, using auth service in Angular and token from Django

**Component.html**

```
<a *ngIf="authService.isLogedin()" style="color:white"   href="/#/login" class="nav-link" (click)="logOut()">Cerrar sesión</a>

```

**auth service.ts**

```
islogedin: boolean = false;

private setSession(authResult) {
  const token = authResult.token;
  const payload = <JWTPayload> jwtDecode(token);
  const expiresAt = moment.unix(payload.exp);

  localStorage.setItem('token', authResult.token);
  localStorage.setItem('expires_at', JSON.stringify(expiresAt.valueOf()));
}

isLogedin() {

    if (JSON.parse(localStorage.getItem('token')).auth_token == null) {
      this.islogedin = false;
      return this.islogedin;
    }
    else {
      return true;
    }
  }

```