@cedarjs/auth-auth0-setup 7.0.1-next.467 → 7.1.0-rc.34
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.
package/dist/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,OAAO,UAAU,CAAA;AAC9B,eAAO,MAAM,WAAW,8BAA8B,CAAA;AAEtD,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI;;;;GAElC;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,IAAI,iBAG1C"}
|
package/dist/setup.js
CHANGED
package/dist/setupHandler.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { standardAuthHandler } from "@cedarjs/cli-helpers
|
|
3
|
+
import { standardAuthHandler } from "@cedarjs/cli-helpers";
|
|
4
4
|
const { version } = JSON.parse(
|
|
5
5
|
fs.readFileSync(
|
|
6
6
|
path.resolve(import.meta.dirname, "../package.json"),
|
|
@@ -3,10 +3,9 @@ import { AuthenticationError, ForbiddenError } from '@cedarjs/graphql-server'
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents the user attributes returned by the decoding the
|
|
6
|
-
* Authentication provider's JWT together with an optional
|
|
7
|
-
* roles.
|
|
6
|
+
* Authentication provider's JWT together with an optional list of roles.
|
|
8
7
|
*/
|
|
9
|
-
type RedwoodUser = Record<string, unknown> & { roles?: string
|
|
8
|
+
type RedwoodUser = Record<string, unknown> & { roles?: string[] }
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* getCurrentUser returns the user information together with
|
|
@@ -39,11 +38,7 @@ export const getCurrentUser = async (
|
|
|
39
38
|
|
|
40
39
|
const roles = decoded[process.env.AUTH0_AUDIENCE + '/roles']
|
|
41
40
|
|
|
42
|
-
if (
|
|
43
|
-
typeof roles === 'string' ||
|
|
44
|
-
(Array.isArray(roles) &&
|
|
45
|
-
roles.every((role): role is string => typeof role === 'string'))
|
|
46
|
-
) {
|
|
41
|
+
if (roles) {
|
|
47
42
|
return { ...decoded, roles }
|
|
48
43
|
}
|
|
49
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-auth0-setup",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0-rc.34",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"test:watch": "vitest watch"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@cedarjs/cli-helpers": "7.0
|
|
42
|
+
"@cedarjs/cli-helpers": "7.1.0-rc.34"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@cedarjs/framework-tools": "7.0
|
|
45
|
+
"@cedarjs/framework-tools": "7.1.0-rc.34",
|
|
46
46
|
"@types/yargs": "17.0.35",
|
|
47
|
-
"concurrently": "9.2.
|
|
48
|
-
"publint": "0.3.
|
|
47
|
+
"concurrently": "9.2.4",
|
|
48
|
+
"publint": "0.3.24",
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
50
|
"vitest": "4.1.11"
|
|
51
51
|
},
|