Skip to content

Commit bc83cd6

Browse files
authored
Merge pull request #90 from topcoder-platform/hotfix-auth-guard
fix roles guard
2 parents 1e0730a + 125118e commit bc83cd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/auth/guards/roles.guard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class RolesGuard implements CanActivate {
2424

2525
const { auth0User = {} } = request;
2626
const userRoles = Object.keys(auth0User).reduce((roles, key) => {
27-
if (key.match(/claims\/roles$/gi)) {
27+
if (key.match(/\/roles$/gi)) {
2828
return auth0User[key] as string[];
2929
}
3030

@@ -36,15 +36,15 @@ export class RolesGuard implements CanActivate {
3636
}
3737

3838
const userHandle = Object.keys(auth0User).reduce((handles, key) => {
39-
if (key.match(/claims\/handle$/gi)) {
39+
if (key.match(/\/handle$/gi)) {
4040
return auth0User[key] as string;
4141
}
4242

4343
return handles;
4444
}, []);
4545

4646
const userId = Object.keys(auth0User).reduce((ids, key) => {
47-
if (key.match(/claims\/userId$/gi)) {
47+
if (key.match(/\/userId$/gi)) {
4848
return auth0User[key] as string;
4949
}
5050

0 commit comments

Comments
 (0)