SUPPORT-8601: Fix
This commit is contained in:
parent
8b87e2985e
commit
6be447b0af
1 changed files with 6 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from "
|
|||
import {Observable} from "rxjs";
|
||||
import {HttpClient, HttpParams} from "@angular/common/http";
|
||||
import {CookieService} from "ngx-cookie";
|
||||
import {MessagesService} from "@webbpm/base-package";
|
||||
|
||||
@Injectable({providedIn:'root'})
|
||||
export abstract class AuthGuard implements CanActivate {
|
||||
|
|
@ -10,7 +11,8 @@ export abstract class AuthGuard implements CanActivate {
|
|||
protected constructor(
|
||||
protected router: Router,
|
||||
private httpClient: HttpClient,
|
||||
private cookieService: CookieService
|
||||
private cookieService: CookieService,
|
||||
private messageService: MessagesService
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +30,9 @@ export abstract class AuthGuard implements CanActivate {
|
|||
return true;
|
||||
}
|
||||
else if (error) {
|
||||
throw new Error(error + ', error description =' + errorDescription);
|
||||
let errorMessage = error + ', error description =' + errorDescription;
|
||||
this.messageService.error(errorMessage)
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
else if (code) {
|
||||
const params = new HttpParams().set('code', code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue