Skip to content

Commit

Permalink
fix(rbac): getAccessRoute updated
Browse files Browse the repository at this point in the history
  • Loading branch information
imjulianeral committed Sep 2, 2021
1 parent be66256 commit 40583b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions example/ts-fire-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/ts-fire-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"firebase": "^8.7.0",
"next": "11.0.1",
"next-shield": "^2.0.9",
"next-shield": "^2.0.10",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-firebase-hooks": "^3.0.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/NextShield.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function NextShield<
const pathIsHybrid = verifyPath(hybridRoutes, pathname)
const pathIsAuthorized =
RBAC && userRole && verifyPath(RBAC[userRole].grantedRoutes, pathname)
const access = getAccessRoute(RBAC, userRole, accessRoute)
const access = getAccessRoute(RBAC, userRole, accessRoute) as string

console.log({
userRole,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export function getAccessRoute(

if (RBAC && userRole) return RBAC[userRole].accessRoute

return ''
return undefined
}

0 comments on commit 40583b6

Please sign in to comment.