SUPPORT-8897: Fix
This commit is contained in:
parent
d7c75b3d2e
commit
247c5fe46c
3 changed files with 9 additions and 8 deletions
|
|
@ -2,6 +2,7 @@ import {Injectable} from '@angular/core';
|
|||
import {HttpClient} from '@angular/common/http';
|
||||
import {CookieService} from "ngx-cookie";
|
||||
import {AppConfigService} from "@webbpm/base-package";
|
||||
import {map, tap} from "rxjs/operators";
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
export class AuthenticationService {
|
||||
|
|
@ -24,11 +25,11 @@ export class AuthenticationService {
|
|||
}
|
||||
|
||||
public redirectToEsia() {
|
||||
return this.http.get<string>("esia/url")
|
||||
.toPromise()
|
||||
.then(url => {
|
||||
return this.http.get<string>("esia/url").pipe(
|
||||
tap(url => {
|
||||
window.open(url, "_self");
|
||||
return true;
|
||||
});
|
||||
}),
|
||||
map(() => true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ export abstract class AuthGuard implements CanActivate {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
return this.authenticationService.redirectToEsia().catch((reason) => {
|
||||
return this.authenticationService.redirectToEsia().toPromise().catch((reason) => {
|
||||
console.error(reason);
|
||||
return false;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import {
|
|||
} from "@webbpm/base-package";
|
||||
import {Injectable} from "@angular/core";
|
||||
import {Router} from "@angular/router";
|
||||
import {from, Observable} from "rxjs";
|
||||
import {catchError, map} from "rxjs/operators";
|
||||
import {EMPTY, from, Observable} from "rxjs";
|
||||
import {catchError, map, switchMap} from "rxjs/operators";
|
||||
import {AuthenticationService} from "../../security/authentication.service";
|
||||
|
||||
@Injectable()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue