diff --git a/templates/app-nolayers/angular/src/app/home/home.component.ts b/templates/app-nolayers/angular/src/app/home/home.component.ts index 5e19367b34..a721a23984 100644 --- a/templates/app-nolayers/angular/src/app/home/home.component.ts +++ b/templates/app-nolayers/angular/src/app/home/home.component.ts @@ -1,6 +1,5 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { OAuthService } from 'angular-oauth2-oidc'; @Component({ selector: 'app-home', @@ -9,10 +8,10 @@ import { OAuthService } from 'angular-oauth2-oidc'; }) export class HomeComponent { get hasLoggedIn(): boolean { - return this.oAuthService.hasValidAccessToken(); + return this.authService.isAuthenticated; } - constructor(private oAuthService: OAuthService, private authService: AuthService) {} + constructor(private authService: AuthService) {} login() { this.authService.navigateToLogin(); diff --git a/templates/app/angular/src/app/home/home.component.ts b/templates/app/angular/src/app/home/home.component.ts index 5e19367b34..a721a23984 100644 --- a/templates/app/angular/src/app/home/home.component.ts +++ b/templates/app/angular/src/app/home/home.component.ts @@ -1,6 +1,5 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; -import { OAuthService } from 'angular-oauth2-oidc'; @Component({ selector: 'app-home', @@ -9,10 +8,10 @@ import { OAuthService } from 'angular-oauth2-oidc'; }) export class HomeComponent { get hasLoggedIn(): boolean { - return this.oAuthService.hasValidAccessToken(); + return this.authService.isAuthenticated; } - constructor(private oAuthService: OAuthService, private authService: AuthService) {} + constructor(private authService: AuthService) {} login() { this.authService.navigateToLogin();