Commit 7d90449f by Bharti Ladumor

Authgurad null check

parent 0cd09b13
......@@ -37,14 +37,14 @@ export class AuthGuard implements CanActivate {
if (data.UserName === 'noprivauthtoken') {
const url = window.location.href;
const matches = url.match(/job\/(\d+)\/message-engine/);
if (matches[1]) {
if (matches && matches[1]) {
redirectPage = redirectPage.replace(':jobId', matches[1]);
window.location.href = `${environment.baseUrl + redirectPage}&from=Messaging`;
return false;
}
window.location.href = (`${environment.baseUrl + redirectPage}?url=${encodeURIComponent(url)}`);
return false;
} else {
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