Commit 7d90449f by Bharti Ladumor

Authgurad null check

parent 0cd09b13
...@@ -37,14 +37,14 @@ export class AuthGuard implements CanActivate { ...@@ -37,14 +37,14 @@ export class AuthGuard implements CanActivate {
if (data.UserName === 'noprivauthtoken') { if (data.UserName === 'noprivauthtoken') {
const url = window.location.href; const url = window.location.href;
const matches = url.match(/job\/(\d+)\/message-engine/); const matches = url.match(/job\/(\d+)\/message-engine/);
if (matches[1]) { if (matches && matches[1]) {
redirectPage = redirectPage.replace(':jobId', matches[1]); redirectPage = redirectPage.replace(':jobId', matches[1]);
window.location.href = `${environment.baseUrl + redirectPage}&from=Messaging`; window.location.href = `${environment.baseUrl + redirectPage}&from=Messaging`;
return false; return false;
} }
window.location.href = (`${environment.baseUrl + redirectPage}?url=${encodeURIComponent(url)}`); window.location.href = (`${environment.baseUrl + redirectPage}?url=${encodeURIComponent(url)}`);
return false; return false;
} else { } else {
const privs = route.data.privs as Array<string>; const privs = route.data.privs as Array<string>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment