AW-4673 Fix ERROR Error: Uncaught (in promise): TypeError: ownedRoleClaims.findIndex is not a function
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
ed7f7923ca
commit
9ef6c4d308
@ -50,7 +50,12 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
|
||||
if (!ownedClaims) { resolve(false); }
|
||||
const ownedRoleClaims: string[] = ownedClaims['role'];
|
||||
if (!ownedRoleClaims) { resolve(false); }
|
||||
if (Array.isArray(ownedRoleClaims)) {
|
||||
if (ownedRoleClaims.findIndex(r => r === requiredRoleClaim) <= -1) { resolve(false); }
|
||||
}
|
||||
else {
|
||||
if (ownedRoleClaims !== requiredRoleClaim) { resolve(false); }
|
||||
}
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user