Merge branch 'master' into develop
# Conflicts: # backend/pom.xml # distribution/pom.xml # frontend/pom.xml # pom.xml # resources/pom.xml
This commit is contained in:
commit
f1a5ef66b4
8 changed files with 18 additions and 16 deletions
|
|
@ -4,7 +4,7 @@
|
|||
"filter_cleanup_interval_hours": 720,
|
||||
"filter_cleanup_check_period_minutes": 30,
|
||||
"auth_method": "form",
|
||||
"enable.version.in.url": "false",
|
||||
"enable.version.in.url": "%enable.version.in.url%",
|
||||
"backend.context": "fl",
|
||||
"guard.confirm_exit": false,
|
||||
"message_service_error_timeout": "",
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.8.2-SNAPSHOT
|
||||
%project.version%
|
||||
|
|
|
|||
|
|
@ -13,6 +13,6 @@ export class ValueWithPrefixRenderer implements GridCellValueRenderer {
|
|||
|
||||
render(params: ICellRendererParams): HTMLElement | string {
|
||||
let value = params.valueFormatted ? params.valueFormatted : params.value;
|
||||
return `${this.label} ${value}`;
|
||||
return value ? `${this.label} ${value}` : value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
class EsiaErrorDetail {
|
||||
export class EsiaErrorDetail {
|
||||
private static errors: { [code: string]: string } = {
|
||||
'ESIA-007071': 'Запрос персональных данных по физическим лицам может быть выполнен только с указанием согласий',
|
||||
'ESIA-007055': 'Вход в систему осуществляется с неподтвержденной учетной записью',
|
||||
|
|
@ -6,7 +6,7 @@ class EsiaErrorDetail {
|
|||
'ESIA-007008': 'Сервис авторизации в настоящее время не может выполнить запрос из-за большой нагрузки или технических работ на сервере',
|
||||
};
|
||||
|
||||
static getDescription(code: string): string {
|
||||
public static getDescription(code: string): string {
|
||||
return this.errors[code] || 'Доступ запрещен. Обратитесь к системному администратору. Ошибка ' + code;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Observable} from "rxjs";
|
||||
import {CookieService} from "ngx-cookie";
|
||||
import {tap} from "rxjs/operators";
|
||||
import {AppConfigService} from "@webbpm/base-package";
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
|
|
@ -14,7 +12,7 @@ export class AuthenticationService {
|
|||
}
|
||||
|
||||
checkAuthentication(): Promise<any>{
|
||||
return this.appConfigService.load().then(value => this.http.get<any>("version").toPromise())
|
||||
return this.appConfigService.load().then(() => this.http.get<any>("version").toPromise())
|
||||
}
|
||||
|
||||
logout(): Promise<string> {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {Observable} from "rxjs";
|
|||
import {HttpClient, HttpParams} from "@angular/common/http";
|
||||
import {MessagesService} from "@webbpm/base-package";
|
||||
import {AuthenticationService} from "../authentication.service";
|
||||
import {EsiaErrorDetail} from "../EsiaErrorDetail";
|
||||
|
||||
@Injectable({providedIn:'root'})
|
||||
export abstract class AuthGuard implements CanActivate {
|
||||
|
|
|
|||
|
|
@ -17,14 +17,17 @@ export class AbsoluteUrlCsrfInterceptor implements HttpInterceptor {
|
|||
|
||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
|
||||
let requestToForward = req;
|
||||
if (req.method === 'GET' || req.method === 'HEAD') {
|
||||
return next.handle(req);
|
||||
}
|
||||
let token = this.extractor.getToken();
|
||||
let headerName = TokenConstants.CSRF_HEADER_NAME;
|
||||
|
||||
if (token != null && !req.headers.has(headerName)) {
|
||||
let headers = {};
|
||||
headers[headerName] = token;
|
||||
requestToForward = req.clone({setHeaders: headers});
|
||||
req = req.clone({setHeaders: headers});
|
||||
}
|
||||
return next.handle(requestToForward);
|
||||
return next.handle(req);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue