fix usage of prefix and remove localstorage use in favour of our internal service

This commit is contained in:
Eugenio Romano
2019-12-17 17:13:03 +00:00
parent ffef29fd77
commit 0c9726049a
4 changed files with 11 additions and 7 deletions

View File

@@ -43,15 +43,15 @@ export class AuthGuard extends AuthGuardBase {
}
ticketChange(event: StorageEvent) {
if (event.key === 'ticket-ECM' && event.newValue !== event.oldValue) {
if (event.key.includes('ticket-ECM') && event.newValue !== event.oldValue) {
this.ticketChangeRedirect(event, 'ECM');
}
if (event.key === 'ticket-BPM' && event.newValue !== event.oldValue) {
if (event.key.includes('ticket-BPM') && event.newValue !== event.oldValue) {
this.ticketChangeRedirect(event, 'BPM');
}
if (event.key === JwtHelperService.USER_ACCESS_TOKEN &&
if (event.key.includes(JwtHelperService.USER_ACCESS_TOKEN) &&
this.jwtHelperService.getValueFromToken(event.newValue, JwtHelperService.USER_PREFERRED_USERNAME) !==
this.jwtHelperService.getValueFromToken(event.oldValue, JwtHelperService.USER_PREFERRED_USERNAME)) {
this.ticketChangeRedirect(event, 'ALL');