@cedarjs/auth-netlify-setup 8.0.0-canary.3386 → 8.0.0-canary.3390

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,7 +79,9 @@ export const hasRole = (allowedRoles: AllowedRoles): boolean => {
79
79
 
80
80
  const roles = typeof allowedRoles === 'string' ? [allowedRoles] : allowedRoles
81
81
 
82
- return context.currentUser.roles.some((role) => roles.includes(role))
82
+ return (
83
+ context.currentUser?.roles?.some((role) => roles.includes(role)) ?? false
84
+ )
83
85
  }
84
86
 
85
87
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/auth-netlify-setup",
3
- "version": "8.0.0-canary.3386",
3
+ "version": "8.0.0-canary.3390",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -39,10 +39,10 @@
39
39
  "test:watch": "vitest watch"
40
40
  },
41
41
  "dependencies": {
42
- "@cedarjs/cli-helpers": "8.0.0-canary.3386"
42
+ "@cedarjs/cli-helpers": "8.0.0-canary.3390"
43
43
  },
44
44
  "devDependencies": {
45
- "@cedarjs/framework-tools": "8.0.0-canary.3386",
45
+ "@cedarjs/framework-tools": "8.0.0-canary.3390",
46
46
  "@types/yargs": "17.0.35",
47
47
  "concurrently": "9.2.4",
48
48
  "publint": "0.3.25",