Browse Source
Merge pull request #15359 from rqx110/patch-1
Angular: using AuthService instead of OAuthService
pull/15483/head
Mahmut Gundogdu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
6 deletions
-
templates/app-nolayers/angular/src/app/home/home.component.ts
-
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(); |
|
|
|
|
|
|
|
@ -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(); |
|
|
|
|