Pull request #22: RED-5092: Redirect users with any role to main screen.

Merge in SL/common-ui from RED-5092 to master

* commit 'ed67dcbbdbfdb90ce6e76e5e82e58ec0201fac0f':
  RED-5092: Redirect users with any role to main screen.
This commit is contained in:
Nicoleta Panaghiu 2022-08-31 17:32:23 +02:00
commit 2d9abac1c8

View File

@ -28,7 +28,12 @@ export class IqserAuthGuard extends KeycloakAuthGuard {
return false;
}
await this._userService.loadCurrentUser();
const user = await this._userService.loadCurrentUser();
if (user?.hasAnyRole && route.routeConfig?.path === 'auth-error') {
await this._router.navigate(['/main'])
return false;
}
return true;
}
}