RED-5092: Redirect users with any role to main screen.

This commit is contained in:
Nicoleta Panaghiu 2022-08-31 18:26:42 +03:00
parent 85e9a93998
commit ed67dcbbdb

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;
}
}