@cedarjs/auth-auth0-web 6.0.0-canary.2770 → 6.0.0-canary.2772
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/package.json +6 -16
- package/dist/cjs/auth0.d.ts +0 -13
- package/dist/cjs/auth0.d.ts.map +0 -1
- package/dist/cjs/auth0.js +0 -59
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -28
- package/dist/cjs/package.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-auth0-web",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2772",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -10,28 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"
|
|
13
|
+
"default": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
-
},
|
|
17
|
-
"default": {
|
|
18
|
-
"types": "./dist/cjs/index.d.ts",
|
|
19
|
-
"default": "./dist/cjs/index.js"
|
|
20
16
|
}
|
|
21
17
|
},
|
|
22
18
|
"./dist/auth0": {
|
|
23
|
-
"
|
|
19
|
+
"default": {
|
|
24
20
|
"types": "./dist/auth0.d.ts",
|
|
25
21
|
"default": "./dist/auth0.js"
|
|
26
|
-
},
|
|
27
|
-
"default": {
|
|
28
|
-
"types": "./dist/cjs/auth0.d.ts",
|
|
29
|
-
"default": "./dist/cjs/auth0.js"
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
},
|
|
33
|
-
"main": "./dist/
|
|
34
|
-
"module": "./dist/index.js",
|
|
25
|
+
"main": "./dist/index.js",
|
|
35
26
|
"types": "./dist/index.d.ts",
|
|
36
27
|
"files": [
|
|
37
28
|
"dist"
|
|
@@ -40,7 +31,6 @@
|
|
|
40
31
|
"build": "node ./build.ts",
|
|
41
32
|
"build:pack": "yarn pack -o cedarjs-auth-auth0-web.tgz",
|
|
42
33
|
"build:types": "tsc --build --verbose ./tsconfig.build.json",
|
|
43
|
-
"build:types-cjs": "tsc --build --verbose ./tsconfig.cjs.json",
|
|
44
34
|
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build\"",
|
|
45
35
|
"check:attw": "yarn cedar-fwtools-attw",
|
|
46
36
|
"check:package": "concurrently npm:check:attw yarn:publint",
|
|
@@ -49,11 +39,11 @@
|
|
|
49
39
|
"test:watch": "vitest watch"
|
|
50
40
|
},
|
|
51
41
|
"dependencies": {
|
|
52
|
-
"@cedarjs/auth": "6.0.0-canary.
|
|
42
|
+
"@cedarjs/auth": "6.0.0-canary.2772"
|
|
53
43
|
},
|
|
54
44
|
"devDependencies": {
|
|
55
45
|
"@auth0/auth0-spa-js": "2.24.0",
|
|
56
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
46
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2772",
|
|
57
47
|
"@types/react": "^18.2.55",
|
|
58
48
|
"concurrently": "9.2.4",
|
|
59
49
|
"publint": "0.3.22",
|
package/dist/cjs/auth0.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Auth0Client, LogoutOptions, RedirectLoginOptions } from '@auth0/auth0-spa-js';
|
|
2
|
-
import type { CurrentUser } from '@cedarjs/auth';
|
|
3
|
-
export interface Auth0User {
|
|
4
|
-
}
|
|
5
|
-
export declare function createAuth(auth0Client: Auth0Client, customProviderHooks?: {
|
|
6
|
-
useCurrentUser?: () => Promise<CurrentUser>;
|
|
7
|
-
useHasRole?: (currentUser: CurrentUser | null) => (rolesToCheck: string | string[]) => boolean;
|
|
8
|
-
}): {
|
|
9
|
-
AuthContext: import("react").Context<import("@cedarjs/auth").AuthContextInterface<import("@auth0/auth0-spa-js").User, RedirectLoginOptions<any>, void, LogoutOptions, void, RedirectLoginOptions<any>, void, unknown, unknown, unknown, unknown, Auth0Client> | undefined>;
|
|
10
|
-
AuthProvider: ({ children }: import("@cedarjs/auth").AuthProviderProps) => import("react").JSX.Element;
|
|
11
|
-
useAuth: () => import("@cedarjs/auth").AuthContextInterface<import("@auth0/auth0-spa-js").User, RedirectLoginOptions<any>, void, LogoutOptions, void, RedirectLoginOptions<any>, void, unknown, unknown, unknown, unknown, Auth0Client>;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=auth0.d.ts.map
|
package/dist/cjs/auth0.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth0.d.ts","sourceRoot":"","sources":["../../src/auth0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAKhD,MAAM,WAAW,SAAS;CAAG;AAE7B,wBAAgB,UAAU,CACxB,WAAW,EAAE,WAAW,EACxB,mBAAmB,CAAC,EAAE;IACpB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;IAC3C,UAAU,CAAC,EAAE,CACX,WAAW,EAAE,WAAW,GAAG,IAAI,KAC5B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,OAAO,CAAA;CAClD;;;;EAKF"}
|
package/dist/cjs/auth0.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var auth0_exports = {};
|
|
20
|
-
__export(auth0_exports, {
|
|
21
|
-
createAuth: () => createAuth
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(auth0_exports);
|
|
24
|
-
var import_auth = require("@cedarjs/auth");
|
|
25
|
-
function createAuth(auth0Client, customProviderHooks) {
|
|
26
|
-
const authImplementation = createAuthImplementation(auth0Client);
|
|
27
|
-
return (0, import_auth.createAuthentication)(authImplementation, customProviderHooks);
|
|
28
|
-
}
|
|
29
|
-
function createAuthImplementation(auth0Client) {
|
|
30
|
-
return {
|
|
31
|
-
type: "auth0",
|
|
32
|
-
client: auth0Client,
|
|
33
|
-
restoreAuthState: async () => {
|
|
34
|
-
if (globalThis?.location?.search?.includes("code=") && globalThis?.location?.search?.includes("state=")) {
|
|
35
|
-
const { appState } = await auth0Client.handleRedirectCallback();
|
|
36
|
-
const url = appState?.targetUrl ? appState.targetUrl : window.location.pathname;
|
|
37
|
-
globalThis?.location?.assign(url);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
login: async (options) => auth0Client.loginWithRedirect(options),
|
|
41
|
-
logout: async (options) => auth0Client.logout(options),
|
|
42
|
-
signup: async (options) => auth0Client.loginWithRedirect({
|
|
43
|
-
...options,
|
|
44
|
-
authorizationParams: {
|
|
45
|
-
screen_hint: "signup",
|
|
46
|
-
prompt: "login"
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
49
|
-
getToken: () => auth0Client.getTokenSilently(),
|
|
50
|
-
getUserMetadata: async () => {
|
|
51
|
-
const user = await auth0Client.getUser();
|
|
52
|
-
return user || null;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
createAuth
|
|
59
|
-
});
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var index_exports = {};
|
|
20
|
-
__export(index_exports, {
|
|
21
|
-
createAuth: () => import_auth0.createAuth
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(index_exports);
|
|
24
|
-
var import_auth0 = require("./auth0.js");
|
|
25
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
-
0 && (module.exports = {
|
|
27
|
-
createAuth
|
|
28
|
-
});
|
package/dist/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|