@ctx-core/auth0-ui 10.0.123 → 11.0.4

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/auth0_ui_ctx_I.generated.js.map +1 -1
  3. package/dist/ui/Auth0.svelte +5 -6
  4. package/dist/ui/Auth0_Change_Password_Form.svelte +17 -24
  5. package/dist/ui/Auth0_Dialog_Close.svelte +2 -2
  6. package/dist/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
  7. package/dist/ui/Auth0_Forgot_Password_Form.svelte +10 -14
  8. package/dist/ui/Auth0_Loggedin_If.svelte +1 -1
  9. package/dist/ui/Auth0_Login_Form.svelte +25 -29
  10. package/dist/ui/Auth0_Signup_Form.svelte +34 -35
  11. package/dist/ui/Auth0_c.js +8 -8
  12. package/dist/ui/Auth0_c.js.map +1 -1
  13. package/package.json +19 -15
  14. package/src/auth0_ui_ctx_I.generated.ts +2 -12
  15. package/src/ui/Auth0.svelte +5 -6
  16. package/src/ui/Auth0_Change_Password_Form.svelte +17 -24
  17. package/src/ui/Auth0_Dialog_Close.svelte +2 -2
  18. package/src/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
  19. package/src/ui/Auth0_Forgot_Password_Form.svelte +10 -14
  20. package/src/ui/Auth0_Loggedin_If.svelte +1 -1
  21. package/src/ui/Auth0_Login_Form.svelte +25 -29
  22. package/src/ui/Auth0_Signup_Form.svelte +34 -35
  23. package/src/ui/Auth0_c.ts +16 -15
  24. package/dist/index.browser.js +0 -6
  25. package/dist/index.browser.js.map +0 -1
  26. package/dist/node/index.js +0 -8
  27. package/dist/node/index.js.map +0 -1
  28. package/dist/node/jwks_cert__b.js +0 -19
  29. package/dist/node/jwks_cert__b.js.map +0 -1
  30. package/dist/node/jwks_x5c__b.js +0 -21
  31. package/dist/node/jwks_x5c__b.js.map +0 -1
  32. package/dist/node/jwt_token_decoded__b.js +0 -15
  33. package/dist/node/jwt_token_decoded__b.js.map +0 -1
  34. package/dist/node/koa_jwt_token_decoded__b.js +0 -18
  35. package/dist/node/koa_jwt_token_decoded__b.js.map +0 -1
  36. package/dist/node/verify_jwt_email__b.js +0 -29
  37. package/dist/node/verify_jwt_email__b.js.map +0 -1
  38. package/dist/node/verify_jwt_user_id__b.js +0 -15
  39. package/dist/node/verify_jwt_user_id__b.js.map +0 -1
  40. package/src/index.browser.js +0 -4
  41. package/src/node/index.ts +0 -6
  42. package/src/node/jwks_cert__b.ts +0 -19
  43. package/src/node/jwks_x5c__b.ts +0 -21
  44. package/src/node/jwt_token_decoded__b.ts +0 -15
  45. package/src/node/koa_jwt_token_decoded__b.ts +0 -19
  46. package/src/node/verify_jwt_email__b.ts +0 -29
  47. package/src/node/verify_jwt_user_id__b.ts +0 -15
package/src/ui/Auth0_c.ts CHANGED
@@ -1,13 +1,4 @@
1
1
  import { onDestroy } from 'svelte'
2
- import { has_dom, dom_a_ } from '@ctx-core/dom'
3
- import { subscribe } from '@ctx-core/store'
4
- import {
5
- auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,
6
- close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,
7
- password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,
8
- post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password,
9
- validate_auth0_forgot_password, validate_auth0_signup
10
- } from '@ctx-core/auth0'
11
2
  import type {
12
3
  auth0_body__T, auth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, logout_auth0_token_error_T,
13
4
  open_auth0_forgot_password_check_email_T, open_auth0_login_T, password_realm_body__T, password_realm_body_T,
@@ -15,6 +6,16 @@ import type {
15
6
  post_auth0_oauth_token_T, post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T,
16
7
  post_auth0_passwordless_start_T, signup_data_I
17
8
  } from '@ctx-core/auth0'
9
+ import {
10
+ auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,
11
+ close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,
12
+ password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,
13
+ post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password,
14
+ validate_auth0_forgot_password, validate_auth0_signup
15
+ } from '@ctx-core/auth0'
16
+ import { has_dom, dom_a_ } from '@ctx-core/dom'
17
+ import { noop } from '@ctx-core/function'
18
+ import { subscribe } from '@ctx-core/store'
18
19
  import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
19
20
  export class Auth0_c {
20
21
  constructor(protected ctx:auth0_ui_Ctx) {}
@@ -97,7 +98,7 @@ export class Auth0_c {
97
98
  }
98
99
  schedule_forms_clear()
99
100
  await this.login({
100
- username: data.email,
101
+ username: data.username,
101
102
  password: data.password,
102
103
  }, schedule_forms_clear)
103
104
  }
@@ -110,7 +111,7 @@ export class Auth0_c {
110
111
  if (!response.ok) {
111
112
  if (response.status == 401) {
112
113
  this.open_auth0_login()
113
- const auth0_token_error = { email: 'Authentication Error - Log in' }
114
+ const auth0_token_error = { username: 'Authentication Error - Log in' }
114
115
  this.logout_auth0_token_error(auth0_token_error)
115
116
  return
116
117
  }
@@ -145,12 +146,12 @@ export class Auth0_c {
145
146
  password_input,
146
147
  password_confirmation_input,
147
148
  } = ctx
148
- const email = email_input.value
149
+ const username = email_input.value
149
150
  const password = password_input.value
150
151
  const password_confirmation = password_confirmation_input.value
151
152
  const auth0_token_error =
152
153
  validate_auth0_signup({
153
- email,
154
+ username,
154
155
  password,
155
156
  password_confirmation
156
157
  })
@@ -159,7 +160,7 @@ export class Auth0_c {
159
160
  return false
160
161
  }
161
162
  await this.signup({
162
- email,
163
+ username,
163
164
  password
164
165
  }, schedule_forms_clear)
165
166
  return
@@ -191,7 +192,7 @@ export class Auth0_c {
191
192
  this.open_auth0_forgot_password_check_email()
192
193
  }
193
194
  readonly onsubmit_change_password = async (
194
- event:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = ()=>{}
195
+ event:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = noop
195
196
  )=>{
196
197
  event.preventDefault()
197
198
  const {
@@ -1,6 +0,0 @@
1
- export * from './auth0_ui_Ctx.js';
2
- export * from './auth0_ui_ctx_key.js';
3
- export * from './auth_script_html_.js';
4
- export * from './getContext_auth0_ui_ctx.js';
5
-
6
- //# sourceMappingURL=index.browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.browser.js"],"sourcesContent":["export * from './auth0_ui_Ctx.js'\nexport * from './auth0_ui_ctx_key.js'\nexport * from './auth_script_html_.js'\nexport * from './getContext_auth0_ui_ctx.js'\n"],"names":[],"mappings":"cAAc,CAAmB;cACnB,CAAuB;cACvB,CAAwB;cACxB,CAA8B"}
@@ -1,8 +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
-
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["export * from './jwks_cert__b.js'\nexport * from './jwks_x5c__b.js'\nexport * from './jwt_token_decoded__b.js'\nexport * from './koa_jwt_token_decoded__b.js'\nexport * from './verify_jwt_email__b.js'\nexport * from './verify_jwt_user_id__b.js'\n"],"names":[],"mappings":"cAAc,CAAmB;cACnB,CAAkB;cAClB,CAA2B;cAC3B,CAA+B;cAC/B,CAA0B;cAC1B,CAA4B"}
@@ -1,19 +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 = [
11
- '-----BEGIN CERTIFICATE-----',
12
- injwks_cert_fn,
13
- '-----END CERTIFICATE-----'
14
- ].join('\n');
15
- return jwks_cert;
16
- }
17
- });
18
-
19
- //# sourceMappingURL=jwks_cert__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/jwks_cert__b.ts"],"sourcesContent":["import { be_, B } from '@ctx-core/object'\nimport { jwks_x5c__b } from './jwks_x5c__b.js'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nconst key = 'jwks_cert_'\nexport const jwks_cert__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst jwks_x5c_ = jwks_x5c__b(ctx)\n\treturn jwks_cert_ as jwks_cert__T\n\tasync function jwks_cert_() {\n\t\tconst jwks_x5c = await jwks_x5c_()\n\t\tconst injwks_cert_fn = jwks_x5c[0]\n\t\tconst jwks_cert =\n\t\t\t['-----BEGIN CERTIFICATE-----',\n\t\t\t\tinjwks_cert_fn,\n\t\t\t\t'-----END CERTIFICATE-----'\n\t\t\t].join('\\n')\n\t\treturn jwks_cert\n\t}\n})\nexport type jwks_cert__T = ()=>Promise<string>\n"],"names":["be_","jwks_x5c__b","key","jwks_cert__b","ctx","jwks_x5c_","jwks_cert_","jwks_x5c","injwks_cert_fn","jwks_cert","join"],"mappings":"AAAA,MAAM,GAAGA,GAAG,QAAW,CAAkB;AACzC,MAAM,GAAGC,WAAW,QAAQ,CAAkB;AAE9C,KAAK,CAACC,GAAG,GAAG,CAAY;AACxB,MAAM,CAAC,KAAK,CAACC,YAAY,GAA+BH,GAAG,CAACE,GAAG,GAAEE,GAAG,GAAE,CAAC;IACtE,KAAK,CAACC,SAAS,GAAGJ,WAAW,CAACG,GAAG;IACjC,MAAM,CAACE,UAAU;mBACFA,UAAU,GAAG,CAAC;QAC5B,KAAK,CAACC,QAAQ,GAAG,KAAK,CAACF,SAAS;QAChC,KAAK,CAACG,cAAc,GAAGD,QAAQ,CAAC,CAAC;QACjC,KAAK,CAACE,SAAS,GACd,CAAC;YAAA,CAA6B;YAC7BD,cAAc;YACd,CAA2B;QAC5B,CAAC,CAACE,IAAI,CAAC,CAAI;QACZ,MAAM,CAACD,SAAS;IACjB,CAAC;AACF,CAAC"}
@@ -1,21 +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 key1 = 'jwks_x5c_';
5
- export const jwks_x5c__b = be_(key1, (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
-
21
- //# sourceMappingURL=jwks_x5c__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/jwks_x5c__b.ts"],"sourcesContent":["import { be_, B } from '@ctx-core/object'\nimport { throw__response__fetch } from '@ctx-core/fetch'\nimport { get_jwks_json_b } from '@ctx-core/auth0'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nconst key = 'jwks_x5c_'\nexport const jwks_x5c__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst get_jwks_json = get_jwks_json_b(ctx)\n\treturn jwks_x5c_ as jwks_x5c__T\n\tasync function jwks_x5c_() {\n\t\tconst response = await get_jwks_json()\n\t\tif (!response.ok) {\n\t\t\tawait throw__response__fetch(response)\n\t\t}\n\t\tconst jwks_json = await response.json()\n\t\tconst { keys } = jwks_json\n\t\tconst key = keys[0]\n\t\tconst { x5c } = key\n\t\treturn x5c\n\t}\n})\nexport type jwks_x5c__T = ()=>Promise<string>\n"],"names":["be_","throw__response__fetch","get_jwks_json_b","key","jwks_x5c__b","ctx","get_jwks_json","jwks_x5c_","response","ok","jwks_json","json","keys","x5c"],"mappings":"AAAA,MAAM,GAAGA,GAAG,QAAW,CAAkB;AACzC,MAAM,GAAGC,sBAAsB,QAAQ,CAAiB;AACxD,MAAM,GAAGC,eAAe,QAAQ,CAAiB;AAEjD,KAAK,CAACC,IAAG,GAAG,CAAW;AACvB,MAAM,CAAC,KAAK,CAACC,WAAW,GAA+BJ,GAAG,CAACG,IAAG,GAAEE,GAAG,GAAE,CAAC;IACrE,KAAK,CAACC,aAAa,GAAGJ,eAAe,CAACG,GAAG;IACzC,MAAM,CAACE,SAAS;mBACDA,SAAS,GAAG,CAAC;QAC3B,KAAK,CAACC,QAAQ,GAAG,KAAK,CAACF,aAAa;QACpC,EAAE,GAAGE,QAAQ,CAACC,EAAE,EAAE,CAAC;YAClB,KAAK,CAACR,sBAAsB,CAACO,QAAQ;QACtC,CAAC;QACD,KAAK,CAACE,SAAS,GAAG,KAAK,CAACF,QAAQ,CAACG,IAAI;QACrC,KAAK,CAAC,CAAC,CAACC,IAAI,EAAC,CAAC,GAAGF,SAAS;QAC1B,KAAK,CAACP,GAAG,GAAGS,IAAI,CAAC,CAAC;QAClB,KAAK,CAAC,CAAC,CAACC,GAAG,EAAC,CAAC,GAAGV,GAAG;QACnB,MAAM,CAACU,GAAG;IACX,CAAC;AACF,CAAC"}
@@ -1,15 +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
-
15
- //# sourceMappingURL=jwt_token_decoded__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/jwt_token_decoded__b.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\nimport { be_, B } from '@ctx-core/object'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nimport { jwks_cert__b } from './jwks_cert__b.js'\nconst key = 'jwt_token_decoded_'\nexport const jwt_token_decoded__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst jwks_cert_ = jwks_cert__b(ctx)\n\treturn jwt_token_decoded_ as jwt_token_decoded__T\n\tasync function jwt_token_decoded_(jwt_token:string):Promise<object|string> {\n\t\tconst jwks_cert = await jwks_cert_()\n\t\tconst auth0_token_decoded = jwt.verify(jwt_token, jwks_cert)\n\t\treturn auth0_token_decoded\n\t}\n})\nexport type jwt_token_decoded__T = (jwt_token:string)=>Promise<object|string>\n"],"names":["jwt","be_","jwks_cert__b","key","jwt_token_decoded__b","ctx","jwks_cert_","jwt_token_decoded_","jwt_token","jwks_cert","auth0_token_decoded","verify"],"mappings":"AAAA,MAAM,CAACA,GAAG,MAAM,CAAc;AAC9B,MAAM,GAAGC,GAAG,QAAW,CAAkB;AAEzC,MAAM,GAAGC,YAAY,QAAQ,CAAmB;AAChD,KAAK,CAACC,GAAG,GAAG,CAAoB;AAChC,MAAM,CAAC,KAAK,CAACC,oBAAoB,GAA+BH,GAAG,CAACE,GAAG,GAAEE,GAAG,GAAE,CAAC;IAC9E,KAAK,CAACC,UAAU,GAAGJ,YAAY,CAACG,GAAG;IACnC,MAAM,CAACE,kBAAkB;mBACVA,kBAAkB,CAACC,SAAgB,EAAyB,CAAC;QAC3E,KAAK,CAACC,SAAS,GAAG,KAAK,CAACH,UAAU;QAClC,KAAK,CAACI,mBAAmB,GAAGV,GAAG,CAACW,MAAM,CAACH,SAAS,EAAEC,SAAS;QAC3D,MAAM,CAACC,mBAAmB;IAC3B,CAAC;AACF,CAAC"}
@@ -1,18 +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
- }
14
- return await jwt_token_decoded_(jwt_token);
15
- };
16
- });
17
-
18
- //# sourceMappingURL=koa_jwt_token_decoded__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/koa_jwt_token_decoded__b.ts"],"sourcesContent":["import type { nullish } from '@ctx-core/function'\nimport { be_, B } from '@ctx-core/object'\nimport { header_authorization_jwt_token_ } from '@ctx-core/jwt'\nimport { error_ctx_I, throw_bad_credentials } from '@ctx-core/error'\nimport type { jwt_token_decoded_I } from '@ctx-core/auth0'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nimport { jwt_token_decoded__b } from './jwt_token_decoded__b.js'\nconst key = 'koa_jwt_token_decoded_'\nexport const koa_jwt_token_decoded__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst jwt_token_decoded_ = jwt_token_decoded__b(ctx)\n\treturn async function koa_jwt_token_decoded_(authorization:string|nullish):Promise<jwt_token_decoded_I> {\n\t\tconst jwt_token = header_authorization_jwt_token_(authorization)\n\t\tif (!jwt_token) {\n\t\t\tthrow_bad_credentials({} as error_ctx_I)\n\t\t}\n\t\treturn await jwt_token_decoded_(jwt_token!) as jwt_token_decoded_I\n\t}\n})\nexport type koa_jwt_token_decoded__T = (authorization:string|undefined)=>Promise<jwt_token_decoded_I>\n"],"names":["be_","header_authorization_jwt_token_","throw_bad_credentials","jwt_token_decoded__b","key","koa_jwt_token_decoded__b","ctx","jwt_token_decoded_","koa_jwt_token_decoded_","authorization","jwt_token"],"mappings":"AACA,MAAM,GAAGA,GAAG,QAAW,CAAkB;AACzC,MAAM,GAAGC,+BAA+B,QAAQ,CAAe;AAC/D,MAAM,GAAgBC,qBAAqB,QAAQ,CAAiB;AAGpE,MAAM,GAAGC,oBAAoB,QAAQ,CAA2B;AAChE,KAAK,CAACC,GAAG,GAAG,CAAwB;AACpC,MAAM,CAAC,KAAK,CAACC,wBAAwB,GAA+BL,GAAG,CAACI,GAAG,GAAEE,GAAG,GAAE,CAAC;IAClF,KAAK,CAACC,kBAAkB,GAAGJ,oBAAoB,CAACG,GAAG;IACnD,MAAM,gBAAgBE,sBAAsB,CAACC,aAA4B,EAA+B,CAAC;QACxG,KAAK,CAACC,SAAS,GAAGT,+BAA+B,CAACQ,aAAa;QAC/D,EAAE,GAAGC,SAAS,EAAE,CAAC;YAChBR,qBAAqB,CAAC,CAAC;YAAA,CAAC;QACzB,CAAC;QACD,MAAM,CAAC,KAAK,CAACK,kBAAkB,CAACG,SAAS;IAC1C,CAAC;AACF,CAAC"}
@@ -1,29 +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
-
29
- //# sourceMappingURL=verify_jwt_email__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/verify_jwt_email__b.ts"],"sourcesContent":["import { be_, B } from '@ctx-core/object'\nimport { user_id_, validate_auth0_user } from '@ctx-core/auth0'\nimport { get_auth0_v2_user_b} from '@ctx-core/auth0-management'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nimport { koa_jwt_token_decoded__b} from './koa_jwt_token_decoded__b.js'\nconst key = 'verify_jwt_email_'\nexport const verify_jwt_email__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst get_auth0_v2_user = get_auth0_v2_user_b(ctx)\n\tconst koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx)\n\treturn verify_jwt_email_ as verify_jwt_email__T\n\tasync function verify_jwt_email_(authorization:string) {\n\t\tconst koajwt_token_decoded_fn = await koa_jwt_token_decoded_(authorization)\n\t\tlet email = koajwt_token_decoded_fn.email\n\t\tif (!email) {\n\t\t\tconst user_id = user_id_(koajwt_token_decoded_fn)\n\t\t\tconst AUTH0_DOMAIN = process.env.AUTH0_DOMAIN as string\n\t\t\tconst request_ctx = {\n\t\t\t\tAUTH0_DOMAIN,\n\t\t\t\tuser_id\n\t\t\t}\n\t\t\tconst response = await get_auth0_v2_user(request_ctx)\n\t\t\tconst user = await response.json()\n\t\t\tvalidate_auth0_user(user)\n\t\t\temail = user.email\n\t\t}\n\t\treturn email\n\t}\n})\nexport type verify_jwt_email__T = (authorization:string)=>Promise<string>\n"],"names":["be_","user_id_","validate_auth0_user","get_auth0_v2_user_b","koa_jwt_token_decoded__b","key","verify_jwt_email__b","ctx","get_auth0_v2_user","koa_jwt_token_decoded_","verify_jwt_email_","authorization","koajwt_token_decoded_fn","email","user_id","AUTH0_DOMAIN","process","env","request_ctx","response","user","json"],"mappings":"AAAA,MAAM,GAAGA,GAAG,QAAW,CAAkB;AACzC,MAAM,GAAGC,QAAQ,EAAEC,mBAAmB,QAAQ,CAAiB;AAC/D,MAAM,GAAGC,mBAAmB,QAAO,CAA4B;AAE/D,MAAM,GAAGC,wBAAwB,QAAO,CAA+B;AACvE,KAAK,CAACC,GAAG,GAAG,CAAmB;AAC/B,MAAM,CAAC,KAAK,CAACC,mBAAmB,GAA+BN,GAAG,CAACK,GAAG,GAAEE,GAAG,GAAE,CAAC;IAC7E,KAAK,CAACC,iBAAiB,GAAGL,mBAAmB,CAACI,GAAG;IACjD,KAAK,CAACE,sBAAsB,GAAGL,wBAAwB,CAACG,GAAG;IAC3D,MAAM,CAACG,iBAAiB;mBACTA,iBAAiB,CAACC,aAAoB,EAAE,CAAC;QACvD,KAAK,CAACC,uBAAuB,GAAG,KAAK,CAACH,sBAAsB,CAACE,aAAa;QAC1E,GAAG,CAACE,KAAK,GAAGD,uBAAuB,CAACC,KAAK;QACzC,EAAE,GAAGA,KAAK,EAAE,CAAC;YACZ,KAAK,CAACC,OAAO,GAAGb,QAAQ,CAACW,uBAAuB;YAChD,KAAK,CAACG,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACF,YAAY;YAC7C,KAAK,CAACG,WAAW,GAAG,CAAC;gBACpBH,YAAY;gBACZD,OAAO;YACR,CAAC;YACD,KAAK,CAACK,QAAQ,GAAG,KAAK,CAACX,iBAAiB,CAACU,WAAW;YACpD,KAAK,CAACE,IAAI,GAAG,KAAK,CAACD,QAAQ,CAACE,IAAI;YAChCnB,mBAAmB,CAACkB,IAAI;YACxBP,KAAK,GAAGO,IAAI,CAACP,KAAK;QACnB,CAAC;QACD,MAAM,CAACA,KAAK;IACb,CAAC;AACF,CAAC"}
@@ -1,15 +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
-
15
- //# sourceMappingURL=verify_jwt_user_id__b.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/node/verify_jwt_user_id__b.ts"],"sourcesContent":["import { be_, B } from '@ctx-core/object'\nimport { user_id_ } from '@ctx-core/auth0'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nimport { koa_jwt_token_decoded__b} from './koa_jwt_token_decoded__b.js'\nconst key = 'verify_jwt_user_id_'\nexport const verify_jwt_user_id__b:B<auth0_ui_Ctx, typeof key> = be_(key, ctx=>{\n\tconst koa_jwt_token_decoded_ = koa_jwt_token_decoded__b(ctx)\n\treturn verify_jwt_user_id_ as verify_jwt_user_id__T\n\tasync function verify_jwt_user_id_(authorization:string) {\n\t\tconst jwt_token_decoded = await koa_jwt_token_decoded_(authorization)\n\t\tconst user_id = user_id_(jwt_token_decoded)\n\t\treturn user_id\n\t}\n})\nexport type verify_jwt_user_id__T = (authorization:string)=>Promise<string>\n"],"names":["be_","user_id_","koa_jwt_token_decoded__b","key","verify_jwt_user_id__b","ctx","koa_jwt_token_decoded_","verify_jwt_user_id_","authorization","jwt_token_decoded","user_id"],"mappings":"AAAA,MAAM,GAAGA,GAAG,QAAW,CAAkB;AACzC,MAAM,GAAGC,QAAQ,QAAQ,CAAiB;AAE1C,MAAM,GAAGC,wBAAwB,QAAO,CAA+B;AACvE,KAAK,CAACC,GAAG,GAAG,CAAqB;AACjC,MAAM,CAAC,KAAK,CAACC,qBAAqB,GAA+BJ,GAAG,CAACG,GAAG,GAAEE,GAAG,GAAE,CAAC;IAC/E,KAAK,CAACC,sBAAsB,GAAGJ,wBAAwB,CAACG,GAAG;IAC3D,MAAM,CAACE,mBAAmB;mBACXA,mBAAmB,CAACC,aAAoB,EAAE,CAAC;QACzD,KAAK,CAACC,iBAAiB,GAAG,KAAK,CAACH,sBAAsB,CAACE,aAAa;QACpE,KAAK,CAACE,OAAO,GAAGT,QAAQ,CAACQ,iBAAiB;QAC1C,MAAM,CAACC,OAAO;IACf,CAAC;AACF,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './auth0_ui_Ctx.js'
2
- export * from './auth0_ui_ctx_key.js'
3
- export * from './auth_script_html_.js'
4
- export * from './getContext_auth0_ui_ctx.js'
package/src/node/index.ts DELETED
@@ -1,6 +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'
@@ -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>
@@ -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>