SUPPORT-8706: add check auth
This commit is contained in:
parent
23816a2f7e
commit
9b0950a21b
2 changed files with 21 additions and 21 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {Router} from "@angular/router";
|
||||
import {AuthenticationService} from "../../modules/security/authentication.service";
|
||||
|
||||
|
||||
@Injectable({
|
||||
|
|
@ -8,10 +9,13 @@ import {Router} from "@angular/router";
|
|||
})
|
||||
export class AuditService {
|
||||
|
||||
constructor(private httpClient: HttpClient, private router: Router) {
|
||||
constructor(private httpClient: HttpClient,
|
||||
private router: Router,
|
||||
private authService: AuthenticationService) {
|
||||
}
|
||||
|
||||
public logActionAudit(eventType: string, fileName?: string): void {
|
||||
if (this.authService.isAuthenticated()) {
|
||||
const currentRoute = this.router.url;
|
||||
const sourceUrl = window.location.href;
|
||||
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||
|
|
@ -29,6 +33,7 @@ export class AuditService {
|
|||
}
|
||||
}).toPromise();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface AuditAction {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,8 @@ export class WebbpmComponent {
|
|||
|| event instanceof NavigationError
|
||||
|| event instanceof NavigationCancel) {
|
||||
progressIndicationService.hideProgressBar();
|
||||
|
||||
if (event instanceof NavigationEnd
|
||||
&& event.url != '/home'
|
||||
&& event.url != '/access-denied') {
|
||||
this.auditService.logActionAudit(AuditConstants.OPEN_PAGE_EVENT);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue