@ctx-core/auth0-ui 10.0.121 → 11.0.2
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/.swcrc +10 -0
- package/CHANGELOG.md +56 -0
- package/dist/auth0_ui_Ctx.js +2 -1
- package/dist/auth0_ui_Ctx.js.map +1 -1
- package/dist/auth0_ui_ctx_I.generated.js +4 -1
- package/dist/auth0_ui_ctx_I.generated.js.map +1 -1
- package/dist/auth0_ui_ctx_key.js +1 -0
- package/dist/auth0_ui_ctx_key.js.map +1 -1
- package/dist/auth_script_html_.js +2 -1
- package/dist/auth_script_html_.js.map +1 -1
- package/dist/getContext_auth0_ui_ctx.js +1 -0
- package/dist/getContext_auth0_ui_ctx.js.map +1 -1
- package/dist/{index.d.ts → index.browser.js} +2 -2
- package/dist/index.browser.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/Auth0.svelte +168 -0
- package/dist/ui/Auth0_Change_Password_Form.svelte +92 -0
- package/dist/ui/Auth0_Dialog_Close.svelte +10 -0
- package/dist/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +10 -0
- package/dist/ui/Auth0_Forgot_Password_Form.svelte +64 -0
- package/dist/ui/Auth0_Loggedin_If.svelte +14 -0
- package/dist/ui/Auth0_Login_Form.svelte +85 -0
- package/dist/ui/Auth0_Signup_Form.svelte +120 -0
- package/dist/ui/Auth0_c.js +58 -42
- package/dist/ui/Auth0_c.js.map +1 -1
- package/dist/ui/index.js +17 -8
- package/dist/ui/index.js.map +1 -1
- package/package.json +26 -22
- package/src/auth0_ui_ctx_I.generated.ts +2 -12
- package/src/ui/Auth0.svelte +5 -6
- package/src/ui/Auth0_Change_Password_Form.svelte +17 -24
- package/src/ui/Auth0_Dialog_Close.svelte +2 -2
- package/src/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
- package/src/ui/Auth0_Forgot_Password_Form.svelte +10 -14
- package/src/ui/Auth0_Loggedin_If.svelte +1 -1
- package/src/ui/Auth0_Login_Form.svelte +25 -29
- package/src/ui/Auth0_Signup_Form.svelte +34 -35
- package/src/ui/Auth0_c.ts +16 -15
- package/dist/auth0_ui_Ctx.d.ts +0 -9
- package/dist/auth0_ui_ctx_I.generated.d.ts +0 -14
- package/dist/auth0_ui_ctx_key.d.ts +0 -1
- package/dist/auth_script_html_.d.ts +0 -2
- package/dist/browser/auth0_ui_ctx_key.d.ts +0 -1
- package/dist/browser/auth0_ui_ctx_key.js +0 -2
- package/dist/browser/auth0_ui_ctx_key.js.map +0 -1
- package/dist/browser/auth_script_html_.d.ts +0 -2
- package/dist/browser/auth_script_html_.js +0 -34
- package/dist/browser/auth_script_html_.js.map +0 -1
- package/dist/browser/getContext_auth0_ui_ctx.d.ts +0 -1
- package/dist/browser/getContext_auth0_ui_ctx.js +0 -6
- package/dist/browser/getContext_auth0_ui_ctx.js.map +0 -1
- package/dist/browser/index.d.ts +0 -3
- package/dist/browser/index.js +0 -4
- package/dist/browser/index.js.map +0 -1
- package/dist/getContext_auth0_ui_ctx.d.ts +0 -1
- package/dist/index.cjs +0 -1
- package/dist/node/index.d.ts +0 -6
- package/dist/node/index.js +0 -7
- package/dist/node/index.js.map +0 -1
- package/dist/node/jwks_cert__b.d.ts +0 -6
- package/dist/node/jwks_cert__b.js +0 -17
- package/dist/node/jwks_cert__b.js.map +0 -1
- package/dist/node/jwks_x5c__b.d.ts +0 -6
- package/dist/node/jwks_x5c__b.js +0 -20
- package/dist/node/jwks_x5c__b.js.map +0 -1
- package/dist/node/jwt_token_decoded__b.d.ts +0 -6
- package/dist/node/jwt_token_decoded__b.js +0 -14
- package/dist/node/jwt_token_decoded__b.js.map +0 -1
- package/dist/node/koa_jwt_token_decoded__b.d.ts +0 -7
- package/dist/node/koa_jwt_token_decoded__b.js +0 -16
- package/dist/node/koa_jwt_token_decoded__b.js.map +0 -1
- package/dist/node/verify_jwt_email__b.d.ts +0 -6
- package/dist/node/verify_jwt_email__b.js +0 -28
- package/dist/node/verify_jwt_email__b.js.map +0 -1
- package/dist/node/verify_jwt_user_id__b.d.ts +0 -6
- package/dist/node/verify_jwt_user_id__b.js +0 -14
- package/dist/node/verify_jwt_user_id__b.js.map +0 -1
- package/dist/ui/Auth0_c.d.ts +0 -55
- package/dist/ui/index.d.ts +0 -9
- package/src/node/index.ts +0 -6
- package/src/node/jwks_cert__b.ts +0 -19
- package/src/node/jwks_x5c__b.ts +0 -21
- package/src/node/jwt_token_decoded__b.ts +0 -15
- package/src/node/koa_jwt_token_decoded__b.ts +0 -19
- package/src/node/verify_jwt_email__b.ts +0 -29
- package/src/node/verify_jwt_user_id__b.ts +0 -15
package/dist/node/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './jwks_cert__b.js';
|
|
2
|
-
export * from './jwks_x5c__b.js';
|
|
3
|
-
export * from './jwt_token_decoded__b.js';
|
|
4
|
-
export * from './koa_jwt_token_decoded__b.js';
|
|
5
|
-
export * from './verify_jwt_email__b.js';
|
|
6
|
-
export * from './verify_jwt_user_id__b.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
3
|
-
declare const key = "jwks_cert_";
|
|
4
|
-
export declare const jwks_cert__b: B<auth0_ui_Ctx, typeof key>;
|
|
5
|
-
export declare type jwks_cert__T = () => Promise<string>;
|
|
6
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { jwks_x5c__b } from './jwks_x5c__b.js';
|
|
3
|
-
const key = 'jwks_cert_';
|
|
4
|
-
export const jwks_cert__b = be_(key, ctx => {
|
|
5
|
-
const jwks_x5c_ = jwks_x5c__b(ctx);
|
|
6
|
-
return jwks_cert_;
|
|
7
|
-
async function jwks_cert_() {
|
|
8
|
-
const jwks_x5c = await jwks_x5c_();
|
|
9
|
-
const injwks_cert_fn = jwks_x5c[0];
|
|
10
|
-
const jwks_cert = ['-----BEGIN CERTIFICATE-----',
|
|
11
|
-
injwks_cert_fn,
|
|
12
|
-
'-----END CERTIFICATE-----'
|
|
13
|
-
].join('\n');
|
|
14
|
-
return jwks_cert;
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=jwks_cert__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwks_cert__b.js","sourceRoot":"","sources":["../../src/node/jwks_cert__b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,MAAM,GAAG,GAAG,YAAY,CAAA;AACxB,MAAM,CAAC,MAAM,YAAY,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IACrE,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;IAClC,OAAO,UAA0B,CAAA;IACjC,KAAK,UAAU,UAAU;QACxB,MAAM,QAAQ,GAAG,MAAM,SAAS,EAAE,CAAA;QAClC,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;QAClC,MAAM,SAAS,GACd,CAAC,6BAA6B;YAC7B,cAAc;YACd,2BAA2B;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACb,OAAO,SAAS,CAAA;IACjB,CAAC;AACF,CAAC,CAAC,CAAA"}
|
package/dist/node/jwks_x5c__b.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { throw__response__fetch } from '@ctx-core/fetch';
|
|
3
|
-
import { get_jwks_json_b } from '@ctx-core/auth0';
|
|
4
|
-
const key = 'jwks_x5c_';
|
|
5
|
-
export const jwks_x5c__b = be_(key, ctx => {
|
|
6
|
-
const get_jwks_json = get_jwks_json_b(ctx);
|
|
7
|
-
return jwks_x5c_;
|
|
8
|
-
async function jwks_x5c_() {
|
|
9
|
-
const response = await get_jwks_json();
|
|
10
|
-
if (!response.ok) {
|
|
11
|
-
await throw__response__fetch(response);
|
|
12
|
-
}
|
|
13
|
-
const jwks_json = await response.json();
|
|
14
|
-
const { keys } = jwks_json;
|
|
15
|
-
const key = keys[0];
|
|
16
|
-
const { x5c } = key;
|
|
17
|
-
return x5c;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=jwks_x5c__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwks_x5c__b.js","sourceRoot":"","sources":["../../src/node/jwks_x5c__b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,GAAG,GAAG,WAAW,CAAA;AACvB,MAAM,CAAC,MAAM,WAAW,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IACpE,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;IAC1C,OAAO,SAAwB,CAAA;IAC/B,KAAK,UAAU,SAAS;QACvB,MAAM,QAAQ,GAAG,MAAM,aAAa,EAAE,CAAA;QACtC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YACjB,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAA;SACtC;QACD,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QACvC,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAA;QAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;QACnB,OAAO,GAAG,CAAA;IACX,CAAC;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
3
|
-
declare const key = "jwt_token_decoded_";
|
|
4
|
-
export declare const jwt_token_decoded__b: B<auth0_ui_Ctx, typeof key>;
|
|
5
|
-
export declare type jwt_token_decoded__T = (jwt_token: string) => Promise<object | string>;
|
|
6
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import jwt from 'jsonwebtoken';
|
|
2
|
-
import { be_ } from '@ctx-core/object';
|
|
3
|
-
import { jwks_cert__b } from './jwks_cert__b.js';
|
|
4
|
-
const key = 'jwt_token_decoded_';
|
|
5
|
-
export const jwt_token_decoded__b = be_(key, ctx => {
|
|
6
|
-
const jwks_cert_ = jwks_cert__b(ctx);
|
|
7
|
-
return jwt_token_decoded_;
|
|
8
|
-
async function jwt_token_decoded_(jwt_token) {
|
|
9
|
-
const jwks_cert = await jwks_cert_();
|
|
10
|
-
const auth0_token_decoded = jwt.verify(jwt_token, jwks_cert);
|
|
11
|
-
return auth0_token_decoded;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=jwt_token_decoded__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jwt_token_decoded__b.js","sourceRoot":"","sources":["../../src/node/jwt_token_decoded__b.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,cAAc,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,MAAM,GAAG,GAAG,oBAAoB,CAAA;AAChC,MAAM,CAAC,MAAM,oBAAoB,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IAC7E,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;IACpC,OAAO,kBAA0C,CAAA;IACjD,KAAK,UAAU,kBAAkB,CAAC,SAAgB;QACjD,MAAM,SAAS,GAAG,MAAM,UAAU,EAAE,CAAA;QACpC,MAAM,mBAAmB,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC5D,OAAO,mBAAmB,CAAA;IAC3B,CAAC;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import type { jwt_token_decoded_I } from '@ctx-core/auth0';
|
|
3
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
4
|
-
declare const key = "koa_jwt_token_decoded_";
|
|
5
|
-
export declare const koa_jwt_token_decoded__b: B<auth0_ui_Ctx, typeof key>;
|
|
6
|
-
export declare type koa_jwt_token_decoded__T = (authorization: string | undefined) => Promise<jwt_token_decoded_I>;
|
|
7
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { header_authorization_jwt_token_ } from '@ctx-core/jwt';
|
|
3
|
-
import { throw_bad_credentials } from '@ctx-core/error';
|
|
4
|
-
import { jwt_token_decoded__b } from './jwt_token_decoded__b.js';
|
|
5
|
-
const key = 'koa_jwt_token_decoded_';
|
|
6
|
-
export const koa_jwt_token_decoded__b = be_(key, ctx => {
|
|
7
|
-
const jwt_token_decoded_ = jwt_token_decoded__b(ctx);
|
|
8
|
-
return async function koa_jwt_token_decoded_(authorization) {
|
|
9
|
-
const jwt_token = header_authorization_jwt_token_(authorization);
|
|
10
|
-
if (!jwt_token) {
|
|
11
|
-
throw_bad_credentials({});
|
|
12
|
-
}
|
|
13
|
-
return await jwt_token_decoded_(jwt_token);
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=koa_jwt_token_decoded__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"koa_jwt_token_decoded__b.js","sourceRoot":"","sources":["../../src/node/koa_jwt_token_decoded__b.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAe,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAGpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,MAAM,GAAG,GAAG,wBAAwB,CAAA;AACpC,MAAM,CAAC,MAAM,wBAAwB,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IACjF,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO,KAAK,UAAU,sBAAsB,CAAC,aAA4B;QACxE,MAAM,SAAS,GAAG,+BAA+B,CAAC,aAAa,CAAC,CAAA;QAChE,IAAI,CAAC,SAAS,EAAE;YACf,qBAAqB,CAAC,EAAiB,CAAC,CAAA;SACxC;QACD,OAAO,MAAM,kBAAkB,CAAC,SAAU,CAAwB,CAAA;IACnE,CAAC,CAAA;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
3
|
-
declare const key = "verify_jwt_email_";
|
|
4
|
-
export declare const verify_jwt_email__b: B<auth0_ui_Ctx, typeof key>;
|
|
5
|
-
export declare type verify_jwt_email__T = (authorization: string) => Promise<string>;
|
|
6
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { user_id_, validate_auth0_user } from '@ctx-core/auth0';
|
|
3
|
-
import { get_auth0_v2_user_b } from '@ctx-core/auth0-management';
|
|
4
|
-
import { koa_jwt_token_decoded__b } from './koa_jwt_token_decoded__b.js';
|
|
5
|
-
const key = 'verify_jwt_email_';
|
|
6
|
-
export const verify_jwt_email__b = be_(key, ctx => {
|
|
7
|
-
const get_auth0_v2_user = get_auth0_v2_user_b(ctx);
|
|
8
|
-
const koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx);
|
|
9
|
-
return verify_jwt_email_;
|
|
10
|
-
async function verify_jwt_email_(authorization) {
|
|
11
|
-
const koajwt_token_decoded_fn = await koa_jwt_token_decoded_(authorization);
|
|
12
|
-
let email = koajwt_token_decoded_fn.email;
|
|
13
|
-
if (!email) {
|
|
14
|
-
const user_id = user_id_(koajwt_token_decoded_fn);
|
|
15
|
-
const AUTH0_DOMAIN = process.env.AUTH0_DOMAIN;
|
|
16
|
-
const request_ctx = {
|
|
17
|
-
AUTH0_DOMAIN,
|
|
18
|
-
user_id
|
|
19
|
-
};
|
|
20
|
-
const response = await get_auth0_v2_user(request_ctx);
|
|
21
|
-
const user = await response.json();
|
|
22
|
-
validate_auth0_user(user);
|
|
23
|
-
email = user.email;
|
|
24
|
-
}
|
|
25
|
-
return email;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=verify_jwt_email__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify_jwt_email__b.js","sourceRoot":"","sources":["../../src/node/verify_jwt_email__b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAE/D,OAAO,EAAE,wBAAwB,EAAC,MAAM,+BAA+B,CAAA;AACvE,MAAM,GAAG,GAAG,mBAAmB,CAAA;AAC/B,MAAM,CAAC,MAAM,mBAAmB,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IAC5E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;IAClD,MAAM,sBAAsB,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAA;IAC5D,OAAO,iBAAwC,CAAA;IAC/C,KAAK,UAAU,iBAAiB,CAAC,aAAoB;QACpD,MAAM,uBAAuB,GAAG,MAAM,sBAAsB,CAAC,aAAa,CAAC,CAAA;QAC3E,IAAI,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE;YACX,MAAM,OAAO,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAA;YACjD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAsB,CAAA;YACvD,MAAM,WAAW,GAAG;gBACnB,YAAY;gBACZ,OAAO;aACP,CAAA;YACD,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,WAAW,CAAC,CAAA;YACrD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YAClC,mBAAmB,CAAC,IAAI,CAAC,CAAA;YACzB,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;SAClB;QACD,OAAO,KAAK,CAAA;IACb,CAAC;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { B } from '@ctx-core/object';
|
|
2
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
3
|
-
declare const key = "verify_jwt_user_id_";
|
|
4
|
-
export declare const verify_jwt_user_id__b: B<auth0_ui_Ctx, typeof key>;
|
|
5
|
-
export declare type verify_jwt_user_id__T = (authorization: string) => Promise<string>;
|
|
6
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { be_ } from '@ctx-core/object';
|
|
2
|
-
import { user_id_ } from '@ctx-core/auth0';
|
|
3
|
-
import { koa_jwt_token_decoded__b } from './koa_jwt_token_decoded__b.js';
|
|
4
|
-
const key = 'verify_jwt_user_id_';
|
|
5
|
-
export const verify_jwt_user_id__b = be_(key, ctx => {
|
|
6
|
-
const koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx);
|
|
7
|
-
return verify_jwt_user_id_;
|
|
8
|
-
async function verify_jwt_user_id_(authorization) {
|
|
9
|
-
const jwt_token_decoded = await koa_jwt_token_decoded_(authorization);
|
|
10
|
-
const user_id = user_id_(jwt_token_decoded);
|
|
11
|
-
return user_id;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=verify_jwt_user_id__b.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify_jwt_user_id__b.js","sourceRoot":"","sources":["../../src/node/verify_jwt_user_id__b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAK,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,wBAAwB,EAAC,MAAM,+BAA+B,CAAA;AACvE,MAAM,GAAG,GAAG,qBAAqB,CAAA;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAA,EAAE;IAC9E,MAAM,sBAAsB,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAA;IAC5D,OAAO,mBAA4C,CAAA;IACnD,KAAK,UAAU,mBAAmB,CAAC,aAAoB;QACtD,MAAM,iBAAiB,GAAG,MAAM,sBAAsB,CAAC,aAAa,CAAC,CAAA;QACrE,MAAM,OAAO,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAA;QAC3C,OAAO,OAAO,CAAA;IACf,CAAC;AACF,CAAC,CAAC,CAAA"}
|
package/dist/ui/Auth0_c.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { auth0_body__T, auth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, logout_auth0_token_error_T, open_auth0_forgot_password_check_email_T, open_auth0_login_T, password_realm_body__T, password_realm_body_T, post_auth0_auth_change_password_T, post_auth0_dbconnections_signup_T, post_auth0_oauth_token_body_I, post_auth0_oauth_token_T, post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_T, signup_data_I } from '@ctx-core/auth0';
|
|
2
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js';
|
|
3
|
-
export declare class Auth0_c {
|
|
4
|
-
protected ctx: auth0_ui_Ctx;
|
|
5
|
-
constructor(ctx: auth0_ui_Ctx);
|
|
6
|
-
readonly login_auth0_body_: auth0_body__T<login_data_password_realm_body_I>;
|
|
7
|
-
readonly login_password_realm_body_: password_realm_body__T<login_data_password_realm_body_I>;
|
|
8
|
-
readonly signup_auth0_body_: auth0_body__T<signup_data_password_realm_body_I>;
|
|
9
|
-
readonly signup_password_realm_body_: password_realm_body__T<signup_data_password_realm_body_I>;
|
|
10
|
-
readonly auth0_opened_class: import("@ctx-core/auth0").auth0_opened_class$_T;
|
|
11
|
-
readonly auth0_token_json$: import("@ctx-core/auth0").auth0_token_json$_T;
|
|
12
|
-
readonly auth0_token_error: import("@ctx-core/auth0").auth0_token_error$_T;
|
|
13
|
-
readonly clear_auth0_token_error: import("@ctx-core/auth0").clear_auth0_token_error_T;
|
|
14
|
-
readonly close_auth0: import("@ctx-core/auth0").close_auth0_T;
|
|
15
|
-
readonly logout_auth0_token_error: logout_auth0_token_error_T;
|
|
16
|
-
readonly open_auth0_login: open_auth0_login_T;
|
|
17
|
-
readonly open_auth0_forgot_password_check_email: open_auth0_forgot_password_check_email_T;
|
|
18
|
-
readonly post_auth0_dbconnections_signup: post_auth0_dbconnections_signup_T;
|
|
19
|
-
readonly post_auth0_oauth_token: post_auth0_oauth_token_T;
|
|
20
|
-
readonly post_auth0_auth_change_password: post_auth0_auth_change_password_T;
|
|
21
|
-
readonly post_auth0_passwordless_start: post_auth0_passwordless_start_T;
|
|
22
|
-
readonly onMount: (root: HTMLElement) => Promise<void>;
|
|
23
|
-
readonly login: (data: login_data_I, schedule_forms_clear?: () => void) => Promise<void>;
|
|
24
|
-
readonly signup: (data: signup_data_I, schedule_forms_clear?: () => void) => Promise<void>;
|
|
25
|
-
readonly change_password: (form: {
|
|
26
|
-
password: string;
|
|
27
|
-
}, schedule_forms_clear?: () => void) => Promise<void>;
|
|
28
|
-
readonly schedule_forms_clear_: (root: HTMLElement) => void;
|
|
29
|
-
readonly schedule_forms_clear: (root: HTMLElement) => void;
|
|
30
|
-
readonly onsubmit_signup: (event: Event, ctx: onsubmit_signup_Ctx, schedule_forms_clear?: () => void) => Promise<false | undefined>;
|
|
31
|
-
readonly onsubmit_login: (event: Event, ctx: onsubmit_login_Ctx, schedule_forms_clear?: () => void) => Promise<void>;
|
|
32
|
-
readonly onsubmit_forgot_password: (event: Event, ctx: onsubmit_forgot_password_Ctx) => Promise<void>;
|
|
33
|
-
readonly onsubmit_change_password: (event: Event, ctx: onsubmit_change_password_Ctx, schedule_forms_clear?: () => void) => Promise<void>;
|
|
34
|
-
readonly onclose: (event: MouseEvent) => Promise<void>;
|
|
35
|
-
}
|
|
36
|
-
export interface signup_data_password_realm_body_I extends signup_data_I, auth0_client_id_body_I, post_auth0_passwordless_start_body_T, password_realm_body_T, auth0_grant_type_body_I, post_auth0_oauth_token_body_I {
|
|
37
|
-
}
|
|
38
|
-
export interface login_data_password_realm_body_I extends login_data_I, auth0_client_id_body_I, post_auth0_passwordless_start_body_T, password_realm_body_T, auth0_grant_type_body_I, post_auth0_oauth_token_body_I {
|
|
39
|
-
}
|
|
40
|
-
export interface onsubmit_change_password_Ctx {
|
|
41
|
-
password_input: HTMLInputElement;
|
|
42
|
-
password_confirmation_input: HTMLInputElement;
|
|
43
|
-
}
|
|
44
|
-
export interface onsubmit_forgot_password_Ctx {
|
|
45
|
-
email_input: HTMLInputElement;
|
|
46
|
-
}
|
|
47
|
-
export interface onsubmit_login_Ctx {
|
|
48
|
-
username_login_input: HTMLInputElement;
|
|
49
|
-
password_login_input: HTMLInputElement;
|
|
50
|
-
}
|
|
51
|
-
export interface onsubmit_signup_Ctx {
|
|
52
|
-
email_input: HTMLInputElement;
|
|
53
|
-
password_input: HTMLInputElement;
|
|
54
|
-
password_confirmation_input: HTMLInputElement;
|
|
55
|
-
}
|
package/dist/ui/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import 'svelte';
|
|
2
|
-
export * as Auth0 from './Auth0.svelte';
|
|
3
|
-
export * as Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte';
|
|
4
|
-
export * as Auth0_Change_Password_Form from './Auth0_Change_Password_Form.svelte';
|
|
5
|
-
export * as Auth0_Forgot_Password_Check_Email_Form from './Auth0_Forgot_Password_Check_Email_Form.svelte';
|
|
6
|
-
export * as Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte';
|
|
7
|
-
export * as Auth0_Login_Form from './Auth0_Login_Form.svelte';
|
|
8
|
-
export * as Auth0_Signup_Form from './Auth0_Signup_Form.svelte';
|
|
9
|
-
export * as Auth0_Loggedin_If from './Auth0_Loggedin_If.svelte';
|
package/src/node/index.ts
DELETED
package/src/node/jwks_cert__b.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { be_, B } from '@ctx-core/object'
|
|
2
|
-
import { jwks_x5c__b } from './jwks_x5c__b.js'
|
|
3
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
4
|
-
const key = 'jwks_cert_'
|
|
5
|
-
export const jwks_cert__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
6
|
-
const jwks_x5c_ = jwks_x5c__b(ctx)
|
|
7
|
-
return jwks_cert_ as jwks_cert__T
|
|
8
|
-
async function jwks_cert_() {
|
|
9
|
-
const jwks_x5c = await jwks_x5c_()
|
|
10
|
-
const injwks_cert_fn = jwks_x5c[0]
|
|
11
|
-
const jwks_cert =
|
|
12
|
-
['-----BEGIN CERTIFICATE-----',
|
|
13
|
-
injwks_cert_fn,
|
|
14
|
-
'-----END CERTIFICATE-----'
|
|
15
|
-
].join('\n')
|
|
16
|
-
return jwks_cert
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
export type jwks_cert__T = ()=>Promise<string>
|
package/src/node/jwks_x5c__b.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { be_, B } from '@ctx-core/object'
|
|
2
|
-
import { throw__response__fetch } from '@ctx-core/fetch'
|
|
3
|
-
import { get_jwks_json_b } from '@ctx-core/auth0'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
5
|
-
const key = 'jwks_x5c_'
|
|
6
|
-
export const jwks_x5c__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
7
|
-
const get_jwks_json = get_jwks_json_b(ctx)
|
|
8
|
-
return jwks_x5c_ as jwks_x5c__T
|
|
9
|
-
async function jwks_x5c_() {
|
|
10
|
-
const response = await get_jwks_json()
|
|
11
|
-
if (!response.ok) {
|
|
12
|
-
await throw__response__fetch(response)
|
|
13
|
-
}
|
|
14
|
-
const jwks_json = await response.json()
|
|
15
|
-
const { keys } = jwks_json
|
|
16
|
-
const key = keys[0]
|
|
17
|
-
const { x5c } = key
|
|
18
|
-
return x5c
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
export type jwks_x5c__T = ()=>Promise<string>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import jwt from 'jsonwebtoken'
|
|
2
|
-
import { be_, B } from '@ctx-core/object'
|
|
3
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
4
|
-
import { jwks_cert__b } from './jwks_cert__b.js'
|
|
5
|
-
const key = 'jwt_token_decoded_'
|
|
6
|
-
export const jwt_token_decoded__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
7
|
-
const jwks_cert_ = jwks_cert__b(ctx)
|
|
8
|
-
return jwt_token_decoded_ as jwt_token_decoded__T
|
|
9
|
-
async function jwt_token_decoded_(jwt_token:string):Promise<object|string> {
|
|
10
|
-
const jwks_cert = await jwks_cert_()
|
|
11
|
-
const auth0_token_decoded = jwt.verify(jwt_token, jwks_cert)
|
|
12
|
-
return auth0_token_decoded
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
export type jwt_token_decoded__T = (jwt_token:string)=>Promise<object|string>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { nullish } from '@ctx-core/function'
|
|
2
|
-
import { be_, B } from '@ctx-core/object'
|
|
3
|
-
import { header_authorization_jwt_token_ } from '@ctx-core/jwt'
|
|
4
|
-
import { error_ctx_I, throw_bad_credentials } from '@ctx-core/error'
|
|
5
|
-
import type { jwt_token_decoded_I } from '@ctx-core/auth0'
|
|
6
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
7
|
-
import { jwt_token_decoded__b } from './jwt_token_decoded__b.js'
|
|
8
|
-
const key = 'koa_jwt_token_decoded_'
|
|
9
|
-
export const koa_jwt_token_decoded__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
10
|
-
const jwt_token_decoded_ = jwt_token_decoded__b(ctx)
|
|
11
|
-
return async function koa_jwt_token_decoded_(authorization:string|nullish):Promise<jwt_token_decoded_I> {
|
|
12
|
-
const jwt_token = header_authorization_jwt_token_(authorization)
|
|
13
|
-
if (!jwt_token) {
|
|
14
|
-
throw_bad_credentials({} as error_ctx_I)
|
|
15
|
-
}
|
|
16
|
-
return await jwt_token_decoded_(jwt_token!) as jwt_token_decoded_I
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
export type koa_jwt_token_decoded__T = (authorization:string|undefined)=>Promise<jwt_token_decoded_I>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { be_, B } from '@ctx-core/object'
|
|
2
|
-
import { user_id_, validate_auth0_user } from '@ctx-core/auth0'
|
|
3
|
-
import { get_auth0_v2_user_b} from '@ctx-core/auth0-management'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
5
|
-
import { koa_jwt_token_decoded__b} from './koa_jwt_token_decoded__b.js'
|
|
6
|
-
const key = 'verify_jwt_email_'
|
|
7
|
-
export const verify_jwt_email__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
8
|
-
const get_auth0_v2_user = get_auth0_v2_user_b(ctx)
|
|
9
|
-
const koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx)
|
|
10
|
-
return verify_jwt_email_ as verify_jwt_email__T
|
|
11
|
-
async function verify_jwt_email_(authorization:string) {
|
|
12
|
-
const koajwt_token_decoded_fn = await koa_jwt_token_decoded_(authorization)
|
|
13
|
-
let email = koajwt_token_decoded_fn.email
|
|
14
|
-
if (!email) {
|
|
15
|
-
const user_id = user_id_(koajwt_token_decoded_fn)
|
|
16
|
-
const AUTH0_DOMAIN = process.env.AUTH0_DOMAIN as string
|
|
17
|
-
const request_ctx = {
|
|
18
|
-
AUTH0_DOMAIN,
|
|
19
|
-
user_id
|
|
20
|
-
}
|
|
21
|
-
const response = await get_auth0_v2_user(request_ctx)
|
|
22
|
-
const user = await response.json()
|
|
23
|
-
validate_auth0_user(user)
|
|
24
|
-
email = user.email
|
|
25
|
-
}
|
|
26
|
-
return email
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
export type verify_jwt_email__T = (authorization:string)=>Promise<string>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { be_, B } from '@ctx-core/object'
|
|
2
|
-
import { user_id_ } from '@ctx-core/auth0'
|
|
3
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
4
|
-
import { koa_jwt_token_decoded__b} from './koa_jwt_token_decoded__b.js'
|
|
5
|
-
const key = 'verify_jwt_user_id_'
|
|
6
|
-
export const verify_jwt_user_id__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{
|
|
7
|
-
const koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx)
|
|
8
|
-
return verify_jwt_user_id_ as verify_jwt_user_id__T
|
|
9
|
-
async function verify_jwt_user_id_(authorization:string) {
|
|
10
|
-
const jwt_token_decoded = await koa_jwt_token_decoded_(authorization)
|
|
11
|
-
const user_id = user_id_(jwt_token_decoded)
|
|
12
|
-
return user_id
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
export type verify_jwt_user_id__T = (authorization:string)=>Promise<string>
|