@ctx-core/auth0-ui 12.2.9 → 12.2.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @ctx-core/auth0-ui
2
2
 
3
+ ## 12.2.13
4
+
5
+ ### Patch Changes
6
+
7
+ - update dependencies
8
+ - Updated dependencies
9
+ - @ctx-core/auth0-management@9.0.5
10
+
11
+ ## 12.2.12
12
+
13
+ ### Patch Changes
14
+
15
+ - update dependencies
16
+ - Updated dependencies
17
+ - @ctx-core/auth0-management@9.0.4
18
+
19
+ ## 12.2.11
20
+
21
+ ### Patch Changes
22
+
23
+ - update @ctx-core/auth0
24
+ - Updated dependencies
25
+ - Updated dependencies
26
+ - @ctx-core/auth0@30.0.2
27
+
28
+ ## 12.2.10
29
+
30
+ ### Patch Changes
31
+
32
+ - update dependencies
33
+
3
34
  ## 12.2.9
4
35
 
5
36
  ### Patch Changes
package/COMMIT_EDITMSG ADDED
@@ -0,0 +1 @@
1
+
@@ -11,7 +11,6 @@ export declare class Auth0_c {
11
11
  readonly auth0_opened_class: import("@ctx-core/auth0").auth0_opened_class$_T;
12
12
  readonly auth0_token_json$: import("@ctx-core/auth0").auth0_token_json$_T;
13
13
  readonly auth0_token_error$: import("@ctx-core/auth0").auth0_token_error$_T;
14
- readonly clear_auth0_token_error: import("@ctx-core/auth0").clear_auth0_token_error_T;
15
14
  readonly close_auth0: () => void;
16
15
  readonly onMount: (root: HTMLElement) => Promise<void>;
17
16
  readonly login: (data: login_data_I, schedule_forms_clear?: () => void) => Promise<void>;
@@ -8,7 +8,7 @@ const ctx = getContext_auth0_ui_ctx()
8
8
  const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_(ctx)
9
9
  const auth0_token_error$ = auth0_token_error$_(ctx)
10
10
  const _ = new Auth0_c(ctx)
11
- let email_input:HTMLInputElement, error:string
11
+ let email_input:HTMLInputElement, error:typeof $auth0_token_error$?.error
12
12
  $: error = $auth0_token_error$?.error
13
13
  </script>
14
14
 
package/lib/ui/Auth0_c.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { onDestroy } from 'svelte';
2
- import { auth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error_, close_auth0, logout_auth0_token_error, open_auth0_forgot_password_check_email, open_auth0_login, password_realm_body_, post_auth0_auth_change_password, post_auth0_dbconnections_signup, post_auth0_oauth_token, post_auth0_passwordless_start, validate_auth0_change_password, validate_auth0_forgot_password, validate_auth0_signup } from '@ctx-core/auth0';
2
+ import { auth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error, close_auth0, logout_auth0_token_error, open_auth0_forgot_password_check_email, open_auth0_login, password_realm_body_, post_auth0_auth_change_password, post_auth0_dbconnections_signup, post_auth0_oauth_token, post_auth0_passwordless_start, validate_auth0_change_password, validate_auth0_forgot_password, validate_auth0_signup } from '@ctx-core/auth0';
3
3
  import { has_dom, dom_a_ } from '@ctx-core/dom';
4
4
  import { noop } from '@ctx-core/function';
5
5
  export class Auth0_c {
@@ -16,7 +16,6 @@ export class Auth0_c {
16
16
  this.auth0_opened_class = auth0_opened_class$_(this.ctx);
17
17
  this.auth0_token_json$ = auth0_token_json$_(this.ctx);
18
18
  this.auth0_token_error$ = auth0_token_error$_(this.ctx);
19
- this.clear_auth0_token_error = clear_auth0_token_error_(this.ctx);
20
19
  this.close_auth0 = ()=>close_auth0(this.ctx)
21
20
  ;
22
21
  this.onMount = async (root)=>{
@@ -94,7 +93,7 @@ export class Auth0_c {
94
93
  };
95
94
  this.schedule_forms_clear = (root)=>{
96
95
  setTimeout(()=>{
97
- this.clear_auth0_token_error();
96
+ clear_auth0_token_error(this.ctx);
98
97
  clear_inputs(dom_a_('input[type=text]', root));
99
98
  clear_inputs(dom_a_('input[type=password]', root));
100
99
  }, 100);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/Auth0_c.ts"],"sourcesContent":["import type { Auth0Error } from 'auth0-js'\nimport { onDestroy } from 'svelte'\nimport type {\n\tauth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, password_realm_body_T, post_auth0_oauth_token_body_I,\n\tpost_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T, signup_data_I\n} from '@ctx-core/auth0'\nimport {\n\tauth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error_,\n\tclose_auth0, logout_auth0_token_error, open_auth0_forgot_password_check_email, open_auth0_login,\n\tpassword_realm_body_, post_auth0_auth_change_password, post_auth0_dbconnections_signup,\n\tpost_auth0_oauth_token, post_auth0_passwordless_start, validate_auth0_change_password,\n\tvalidate_auth0_forgot_password, validate_auth0_signup\n} from '@ctx-core/auth0'\nimport { has_dom, dom_a_ } from '@ctx-core/dom'\nimport { noop } from '@ctx-core/function'\nimport type { Ctx } from '@ctx-core/object'\nexport class Auth0_c {\n\tconstructor(protected ctx:Ctx) {}\n\treadonly login_auth0_body_ = (data:any)=>\n\t\tauth0_body_<login_data_password_realm_body_I>(\n\t\t\tthis.ctx, data\n\t\t)\n\treadonly login_password_realm_body_ = (data:any)=>\n\t\tpassword_realm_body_<login_data_password_realm_body_I>(\n\t\t\tthis.ctx,\n\t\t\tthis.login_auth0_body_(data)\n\t\t)\n\treadonly signup_auth0_body_ = (data:any)=>\n\t\tauth0_body_<signup_data_password_realm_body_I>(this.ctx, data) as signup_data_password_realm_body_I\n\treadonly signup_password_realm_body_ = (data:any)=>\n\t\tpassword_realm_body_<signup_data_password_realm_body_I>(this.ctx, this.signup_auth0_body_(data))\n\treadonly auth0_opened_class = auth0_opened_class$_(this.ctx)\n\treadonly auth0_token_json$ = auth0_token_json$_(this.ctx)\n\treadonly auth0_token_error$ = auth0_token_error$_(this.ctx)\n\treadonly clear_auth0_token_error = clear_auth0_token_error_(this.ctx)\n\treadonly close_auth0 = ()=>close_auth0(this.ctx)\n\treadonly onMount = async (root:HTMLElement)=>{\n\t\tif (has_dom) {\n\t\t\tconst unsubscribe =\n\t\t\t\tthis.auth0_opened_class.subscribe(()=>this.schedule_forms_clear(root))\n\t\t\tonDestroy(unsubscribe)\n\t\t}\n\t}\n\treadonly login = async (data:login_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst [auth0_token, response] = await post_auth0_oauth_token(\n\t\t\tthis.ctx, this.login_password_realm_body_(data)\n\t\t)\n\t\tif (response.ok) {\n\t\t\tconst auth0_token_json = JSON.stringify(auth0_token)\n\t\t\tthis.auth0_token_json$.$ = auth0_token_json\n\t\t\tschedule_forms_clear()\n\t\t\tthis.close_auth0()\n\t\t} else {\n\t\t\tconst auth_token_error = auth0_token as Auth0Error\n\t\t\tthis.auth0_token_error$.$ = auth_token_error\n\t\t\tlogout_auth0_token_error(this.ctx, auth_token_error)\n\t\t}\n\t}\n\treadonly signup = async (data:signup_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst [auth0_userinfo] = await post_auth0_dbconnections_signup(\n\t\t\tthis.ctx,\n\t\t\tthis.signup_password_realm_body_(data))\n\t\tconst auth0_userinfo_Auth0Error = auth0_userinfo as Auth0Error\n\t\tconst { statusCode } = auth0_userinfo_Auth0Error\n\t\tif (statusCode) {\n\t\t\tconst {\n\t\t\t\tcode,\n\t\t\t\tdescription\n\t\t\t} = auth0_userinfo_Auth0Error\n\t\t\tconst email =\n\t\t\t\tcode === 'user_exists'\n\t\t\t\t? 'This Email is already signed up'\n\t\t\t\t: description || ''\n\t\t\tconst auth0_token_error = { email }\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tschedule_forms_clear()\n\t\tawait this.login({\n\t\t\tusername: data.email,\n\t\t\tpassword: data.password,\n\t\t}, schedule_forms_clear)\n\t}\n\treadonly change_password = async (form:{ password:string }, schedule_forms_clear = ()=>{})=>{\n\t\tconst { password } = form\n\t\tlet error\n\t\ttry {\n\t\t\tconst [response_json, response] = await post_auth0_auth_change_password(this.ctx, password)\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status == 401) {\n\t\t\t\t\topen_auth0_login(this.ctx)\n\t\t\t\t\tconst auth0_token_error = { username: 'Authentication Error - Log in' }\n\t\t\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\terror = response_json.error || 'Error changing Password'\n\t\t\t}\n\t\t} catch (e:any) {\n\t\t\tconsole.warn(e)\n\t\t\terror = e.message\n\t\t}\n\t\tif (error) {\n\t\t\tconst auth0_token_error = { password: error }\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tschedule_forms_clear()\n\t\tthis.close_auth0()\n\t}\n\treadonly schedule_forms_clear_:(root:HTMLElement)=>void = (root:HTMLElement)=>{\n\t\treturn ()=>this.schedule_forms_clear(root)\n\t}\n\treadonly schedule_forms_clear = (root:HTMLElement)=>{\n\t\tsetTimeout(()=>{\n\t\t\tthis.clear_auth0_token_error()\n\t\t\tclear_inputs(dom_a_('input[type=text]', root))\n\t\t\tclear_inputs(dom_a_('input[type=password]', root))\n\t\t}, 100)\n\t}\n\treadonly onsubmit_signup = async (event:Event, ctx:onsubmit_signup_Ctx, schedule_forms_clear = ()=>{})=>{\n\t\tevent.preventDefault()\n\t\tconst {\n\t\t\temail_input,\n\t\t\tpassword_input,\n\t\t\tpassword_confirmation_input,\n\t\t} = ctx\n\t\tconst email = email_input.value\n\t\tconst password = password_input.value\n\t\tconst password_confirmation = password_confirmation_input.value\n\t\tconst auth0_token_error =\n\t\t\tvalidate_auth0_signup({\n\t\t\t\temail,\n\t\t\t\tpassword,\n\t\t\t\tpassword_confirmation\n\t\t\t})\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn false\n\t\t}\n\t\tawait this.signup({\n\t\t\temail,\n\t\t\tpassword\n\t\t}, schedule_forms_clear)\n\t\treturn\n\t}\n\treadonly onsubmit_login = async (event:Event, ctx:onsubmit_login_Ctx, schedule_forms_clear = ()=>{})=>{\n\t\tevent.preventDefault()\n\t\tconst { username_login_input, password_login_input } = ctx\n\t\tconst username = username_login_input.value\n\t\tconst password = password_login_input.value\n\t\tawait this.login({ username, password }, schedule_forms_clear)\n\t}\n\treadonly onsubmit_forgot_password = async (event:Event, ctx:onsubmit_forgot_password_Ctx)=>{\n\t\tevent.preventDefault()\n\t\tconst { email_input } = ctx\n\t\tconst email = email_input.value\n\t\tconst data:post_auth0_passwordless_start_optional_body_T = {\n\t\t\tconnection: 'email',\n\t\t\tsend: 'link',\n\t\t\temail\n\t\t}\n\t\tconst auth0_token_error = validate_auth0_forgot_password(data)\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tawait post_auth0_passwordless_start(\n\t\t\tthis.ctx, this.login_auth0_body_(data) as post_auth0_passwordless_start_body_T\n\t\t)\n\t\topen_auth0_forgot_password_check_email(this.ctx)\n\t}\n\treadonly onsubmit_change_password = async (\n\t\tevent:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = noop\n\t)=>{\n\t\tevent.preventDefault()\n\t\tconst {\n\t\t\tpassword_input,\n\t\t\tpassword_confirmation_input,\n\t\t} = ctx\n\t\tconst password = password_input.value\n\t\tconst password_confirmation = password_confirmation_input.value\n\t\tconst auth0_token_error =\n\t\t\tvalidate_auth0_change_password(\n\t\t\t\t{\n\t\t\t\t\tpassword,\n\t\t\t\t\tpassword_confirmation\n\t\t\t\t})\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\tthrow auth0_token_error\n\t\t}\n\t\treturn await this.change_password({ password }, schedule_forms_clear)\n\t}\n\treadonly onclose = async (event:MouseEvent)=>{\n\t\tevent.preventDefault()\n\t\tthis.close_auth0()\n\t}\n}\nfunction clear_inputs(inputs:NodeList) {\n\tfor (let i = 0; i < inputs.length; i++) {\n\t\tconst input = inputs[i] as HTMLInputElement\n\t\tinput.value = ''\n\t}\n}\nexport interface signup_data_password_realm_body_I\n\textends signup_data_I,\n\t\tauth0_client_id_body_I,\n\t\tpost_auth0_passwordless_start_body_T,\n\t\tpassword_realm_body_T,\n\t\tauth0_grant_type_body_I,\n\t\tpost_auth0_oauth_token_body_I {}\nexport interface login_data_password_realm_body_I\n\textends login_data_I,\n\t\tauth0_client_id_body_I,\n\t\tpost_auth0_passwordless_start_body_T,\n\t\tpassword_realm_body_T,\n\t\tauth0_grant_type_body_I,\n\t\tpost_auth0_oauth_token_body_I {}\nexport interface onsubmit_change_password_Ctx {\n\tpassword_input:HTMLInputElement\n\tpassword_confirmation_input:HTMLInputElement\n}\nexport interface onsubmit_forgot_password_Ctx {\n\temail_input:HTMLInputElement\n}\nexport interface onsubmit_login_Ctx {\n\tusername_login_input:HTMLInputElement\n\tpassword_login_input:HTMLInputElement\n}\nexport interface onsubmit_signup_Ctx {\n\temail_input:HTMLInputElement\n\tpassword_input:HTMLInputElement\n\tpassword_confirmation_input:HTMLInputElement\n}\n"],"names":["onDestroy","auth0_body_","auth0_opened_class$_","auth0_token_error$_","auth0_token_json$_","clear_auth0_token_error_","close_auth0","logout_auth0_token_error","open_auth0_forgot_password_check_email","open_auth0_login","password_realm_body_","post_auth0_auth_change_password","post_auth0_dbconnections_signup","post_auth0_oauth_token","post_auth0_passwordless_start","validate_auth0_change_password","validate_auth0_forgot_password","validate_auth0_signup","has_dom","dom_a_","noop","Auth0_c","ctx","login_auth0_body_","data","login_password_realm_body_","signup_auth0_body_","signup_password_realm_body_","auth0_opened_class","auth0_token_json$","auth0_token_error$","clear_auth0_token_error","onMount","root","unsubscribe","subscribe","schedule_forms_clear","login","auth0_token","response","ok","auth0_token_json","JSON","stringify","$","auth_token_error","signup","auth0_userinfo","auth0_userinfo_Auth0Error","statusCode","code","description","email","auth0_token_error","username","password","change_password","form","error","response_json","status","e","console","warn","message","schedule_forms_clear_","setTimeout","clear_inputs","onsubmit_signup","event","preventDefault","email_input","password_input","password_confirmation_input","value","password_confirmation","onsubmit_login","username_login_input","password_login_input","onsubmit_forgot_password","connection","send","onsubmit_change_password","onclose","inputs","i","length","input"],"mappings":"AACA,MAAM,GAAGA,SAAS,QAAQ,CAAQ;AAKlC,MAAM,GACLC,WAAW,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,kBAAkB,EAAEC,wBAAwB,EACpGC,WAAW,EAAEC,wBAAwB,EAAEC,sCAAsC,EAAEC,gBAAgB,EAC/FC,oBAAoB,EAAEC,+BAA+B,EAAEC,+BAA+B,EACtFC,sBAAsB,EAAEC,6BAA6B,EAAEC,8BAA8B,EACrFC,8BAA8B,EAAEC,qBAAqB,QAC/C,CAAiB;AACxB,MAAM,GAAGC,OAAO,EAAEC,MAAM,QAAQ,CAAe;AAC/C,MAAM,GAAGC,IAAI,QAAQ,CAAoB;AAEzC,MAAM,OAAOC,OAAO;gBACGC,IAAO,CAAE,CAAC;aAAVA,GAAO,GAAPA,IAAO;QADvB,IAqLN,CAnLSC,iBAAiB,IAAIC,IAAQ,GACrCvB,WAAW,CACV,IAAI,CAACqB,GAAG,EAAEE,IAAI;;QAJV,IAqLN,CA/KSC,0BAA0B,IAAID,IAAQ,GAC9Cd,oBAAoB,CACnB,IAAI,CAACY,GAAG,EACR,IAAI,CAACC,iBAAiB,CAACC,IAAI;;QATvB,IAqLN,CA1KSE,kBAAkB,IAAIF,IAAQ,GACtCvB,WAAW,CAAoC,IAAI,CAACqB,GAAG,EAAEE,IAAI;;QAZxD,IAqLN,CAxKSG,2BAA2B,IAAIH,IAAQ,GAC/Cd,oBAAoB,CAAoC,IAAI,CAACY,GAAG,EAAE,IAAI,CAACI,kBAAkB,CAACF,IAAI;;QAdzF,IAqLN,CAtKSI,kBAAkB,GAAG1B,oBAAoB,CAAC,IAAI,CAACoB,GAAG;QAfrD,IAqLN,CArKSO,iBAAiB,GAAGzB,kBAAkB,CAAC,IAA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,YAAY,CAACiB,MAAe,EAAE,CAAC;IACvC,GAAG,CAAE,GAAG,CAACC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,MAAM,CAACE,MAAM,EAAED,CAAC,GAAI,CAAC;QACxC,KAAK,CAACE,KAAK,GAAGH,MAAM,CAACC,CAAC;QACtBE,KAAK,CAACb,KAAK,GAAG,CAAE;IACjB,CAAC;AACF,CAAC"}
1
+ {"version":3,"sources":["../../src/ui/Auth0_c.ts"],"sourcesContent":["import type { Auth0Error } from 'auth0-js'\nimport { onDestroy } from 'svelte'\nimport type {\n\tauth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, password_realm_body_T, post_auth0_oauth_token_body_I,\n\tpost_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T, signup_data_I\n} from '@ctx-core/auth0'\nimport {\n\tauth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error,\n\tclose_auth0, logout_auth0_token_error, open_auth0_forgot_password_check_email, open_auth0_login,\n\tpassword_realm_body_, post_auth0_auth_change_password, post_auth0_dbconnections_signup,\n\tpost_auth0_oauth_token, post_auth0_passwordless_start, validate_auth0_change_password,\n\tvalidate_auth0_forgot_password, validate_auth0_signup\n} from '@ctx-core/auth0'\nimport { has_dom, dom_a_ } from '@ctx-core/dom'\nimport { noop } from '@ctx-core/function'\nimport type { Ctx } from '@ctx-core/object'\nexport class Auth0_c {\n\tconstructor(protected ctx:Ctx) {}\n\treadonly login_auth0_body_ = (data:any)=>\n\t\tauth0_body_<login_data_password_realm_body_I>(\n\t\t\tthis.ctx, data\n\t\t)\n\treadonly login_password_realm_body_ = (data:any)=>\n\t\tpassword_realm_body_<login_data_password_realm_body_I>(\n\t\t\tthis.ctx,\n\t\t\tthis.login_auth0_body_(data)\n\t\t)\n\treadonly signup_auth0_body_ = (data:any)=>\n\t\tauth0_body_<signup_data_password_realm_body_I>(this.ctx, data) as signup_data_password_realm_body_I\n\treadonly signup_password_realm_body_ = (data:any)=>\n\t\tpassword_realm_body_<signup_data_password_realm_body_I>(this.ctx, this.signup_auth0_body_(data))\n\treadonly auth0_opened_class = auth0_opened_class$_(this.ctx)\n\treadonly auth0_token_json$ = auth0_token_json$_(this.ctx)\n\treadonly auth0_token_error$ = auth0_token_error$_(this.ctx)\n\treadonly close_auth0 = ()=>close_auth0(this.ctx)\n\treadonly onMount = async (root:HTMLElement)=>{\n\t\tif (has_dom) {\n\t\t\tconst unsubscribe =\n\t\t\t\tthis.auth0_opened_class.subscribe(()=>this.schedule_forms_clear(root))\n\t\t\tonDestroy(unsubscribe)\n\t\t}\n\t}\n\treadonly login = async (data:login_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst [auth0_token, response] = await post_auth0_oauth_token(\n\t\t\tthis.ctx, this.login_password_realm_body_(data)\n\t\t)\n\t\tif (response.ok) {\n\t\t\tconst auth0_token_json = JSON.stringify(auth0_token)\n\t\t\tthis.auth0_token_json$.$ = auth0_token_json\n\t\t\tschedule_forms_clear()\n\t\t\tthis.close_auth0()\n\t\t} else {\n\t\t\tconst auth_token_error = auth0_token as Auth0Error\n\t\t\tthis.auth0_token_error$.$ = auth_token_error\n\t\t\tlogout_auth0_token_error(this.ctx, auth_token_error)\n\t\t}\n\t}\n\treadonly signup = async (data:signup_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst [auth0_userinfo] = await post_auth0_dbconnections_signup(\n\t\t\tthis.ctx,\n\t\t\tthis.signup_password_realm_body_(data))\n\t\tconst auth0_userinfo_Auth0Error = auth0_userinfo as Auth0Error\n\t\tconst { statusCode } = auth0_userinfo_Auth0Error\n\t\tif (statusCode) {\n\t\t\tconst {\n\t\t\t\tcode,\n\t\t\t\tdescription\n\t\t\t} = auth0_userinfo_Auth0Error\n\t\t\tconst email =\n\t\t\t\tcode === 'user_exists'\n\t\t\t\t? 'This Email is already signed up'\n\t\t\t\t: description || ''\n\t\t\tconst auth0_token_error = { email }\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tschedule_forms_clear()\n\t\tawait this.login({\n\t\t\tusername: data.email,\n\t\t\tpassword: data.password,\n\t\t}, schedule_forms_clear)\n\t}\n\treadonly change_password = async (form:{ password:string }, schedule_forms_clear = ()=>{})=>{\n\t\tconst { password } = form\n\t\tlet error\n\t\ttry {\n\t\t\tconst [response_json, response] = await post_auth0_auth_change_password(this.ctx, password)\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status == 401) {\n\t\t\t\t\topen_auth0_login(this.ctx)\n\t\t\t\t\tconst auth0_token_error = { username: 'Authentication Error - Log in' }\n\t\t\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\terror = response_json.error || 'Error changing Password'\n\t\t\t}\n\t\t} catch (e:any) {\n\t\t\tconsole.warn(e)\n\t\t\terror = e.message\n\t\t}\n\t\tif (error) {\n\t\t\tconst auth0_token_error = { password: error }\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tschedule_forms_clear()\n\t\tthis.close_auth0()\n\t}\n\treadonly schedule_forms_clear_:(root:HTMLElement)=>void = (root:HTMLElement)=>{\n\t\treturn ()=>this.schedule_forms_clear(root)\n\t}\n\treadonly schedule_forms_clear = (root:HTMLElement)=>{\n\t\tsetTimeout(()=>{\n\t\t\tclear_auth0_token_error(this.ctx)\n\t\t\tclear_inputs(dom_a_('input[type=text]', root))\n\t\t\tclear_inputs(dom_a_('input[type=password]', root))\n\t\t}, 100)\n\t}\n\treadonly onsubmit_signup = async (event:Event, ctx:onsubmit_signup_Ctx, schedule_forms_clear = ()=>{})=>{\n\t\tevent.preventDefault()\n\t\tconst {\n\t\t\temail_input,\n\t\t\tpassword_input,\n\t\t\tpassword_confirmation_input,\n\t\t} = ctx\n\t\tconst email = email_input.value\n\t\tconst password = password_input.value\n\t\tconst password_confirmation = password_confirmation_input.value\n\t\tconst auth0_token_error =\n\t\t\tvalidate_auth0_signup({\n\t\t\t\temail,\n\t\t\t\tpassword,\n\t\t\t\tpassword_confirmation\n\t\t\t})\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn false\n\t\t}\n\t\tawait this.signup({\n\t\t\temail,\n\t\t\tpassword\n\t\t}, schedule_forms_clear)\n\t\treturn\n\t}\n\treadonly onsubmit_login = async (event:Event, ctx:onsubmit_login_Ctx, schedule_forms_clear = ()=>{})=>{\n\t\tevent.preventDefault()\n\t\tconst { username_login_input, password_login_input } = ctx\n\t\tconst username = username_login_input.value\n\t\tconst password = password_login_input.value\n\t\tawait this.login({ username, password }, schedule_forms_clear)\n\t}\n\treadonly onsubmit_forgot_password = async (event:Event, ctx:onsubmit_forgot_password_Ctx)=>{\n\t\tevent.preventDefault()\n\t\tconst { email_input } = ctx\n\t\tconst email = email_input.value\n\t\tconst data:post_auth0_passwordless_start_optional_body_T = {\n\t\t\tconnection: 'email',\n\t\t\tsend: 'link',\n\t\t\temail\n\t\t}\n\t\tconst auth0_token_error = validate_auth0_forgot_password(data)\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tawait post_auth0_passwordless_start(\n\t\t\tthis.ctx, this.login_auth0_body_(data) as post_auth0_passwordless_start_body_T\n\t\t)\n\t\topen_auth0_forgot_password_check_email(this.ctx)\n\t}\n\treadonly onsubmit_change_password = async (\n\t\tevent:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = noop\n\t)=>{\n\t\tevent.preventDefault()\n\t\tconst {\n\t\t\tpassword_input,\n\t\t\tpassword_confirmation_input,\n\t\t} = ctx\n\t\tconst password = password_input.value\n\t\tconst password_confirmation = password_confirmation_input.value\n\t\tconst auth0_token_error =\n\t\t\tvalidate_auth0_change_password(\n\t\t\t\t{\n\t\t\t\t\tpassword,\n\t\t\t\t\tpassword_confirmation\n\t\t\t\t})\n\t\tif (auth0_token_error) {\n\t\t\tlogout_auth0_token_error(this.ctx, auth0_token_error)\n\t\t\tthrow auth0_token_error\n\t\t}\n\t\treturn await this.change_password({ password }, schedule_forms_clear)\n\t}\n\treadonly onclose = async (event:MouseEvent)=>{\n\t\tevent.preventDefault()\n\t\tthis.close_auth0()\n\t}\n}\nfunction clear_inputs(inputs:NodeList) {\n\tfor (let i = 0; i < inputs.length; i++) {\n\t\tconst input = inputs[i] as HTMLInputElement\n\t\tinput.value = ''\n\t}\n}\nexport interface signup_data_password_realm_body_I\n\textends signup_data_I,\n\t\tauth0_client_id_body_I,\n\t\tpost_auth0_passwordless_start_body_T,\n\t\tpassword_realm_body_T,\n\t\tauth0_grant_type_body_I,\n\t\tpost_auth0_oauth_token_body_I {}\nexport interface login_data_password_realm_body_I\n\textends login_data_I,\n\t\tauth0_client_id_body_I,\n\t\tpost_auth0_passwordless_start_body_T,\n\t\tpassword_realm_body_T,\n\t\tauth0_grant_type_body_I,\n\t\tpost_auth0_oauth_token_body_I {}\nexport interface onsubmit_change_password_Ctx {\n\tpassword_input:HTMLInputElement\n\tpassword_confirmation_input:HTMLInputElement\n}\nexport interface onsubmit_forgot_password_Ctx {\n\temail_input:HTMLInputElement\n}\nexport interface onsubmit_login_Ctx {\n\tusername_login_input:HTMLInputElement\n\tpassword_login_input:HTMLInputElement\n}\nexport interface onsubmit_signup_Ctx {\n\temail_input:HTMLInputElement\n\tpassword_input:HTMLInputElement\n\tpassword_confirmation_input:HTMLInputElement\n}\n"],"names":["onDestroy","auth0_body_","auth0_opened_class$_","auth0_token_error$_","auth0_token_json$_","clear_auth0_token_error","close_auth0","logout_auth0_token_error","open_auth0_forgot_password_check_email","open_auth0_login","password_realm_body_","post_auth0_auth_change_password","post_auth0_dbconnections_signup","post_auth0_oauth_token","post_auth0_passwordless_start","validate_auth0_change_password","validate_auth0_forgot_password","validate_auth0_signup","has_dom","dom_a_","noop","Auth0_c","ctx","login_auth0_body_","data","login_password_realm_body_","signup_auth0_body_","signup_password_realm_body_","auth0_opened_class","auth0_token_json$","auth0_token_error$","onMount","root","unsubscribe","subscribe","schedule_forms_clear","login","auth0_token","response","ok","auth0_token_json","JSON","stringify","$","auth_token_error","signup","auth0_userinfo","auth0_userinfo_Auth0Error","statusCode","code","description","email","auth0_token_error","username","password","change_password","form","error","response_json","status","e","console","warn","message","schedule_forms_clear_","setTimeout","clear_inputs","onsubmit_signup","event","preventDefault","email_input","password_input","password_confirmation_input","value","password_confirmation","onsubmit_login","username_login_input","password_login_input","onsubmit_forgot_password","connection","send","onsubmit_change_password","onclose","inputs","i","length","input"],"mappings":"AACA,MAAM,GAAGA,SAAS,QAAQ,CAAQ;AAKlC,MAAM,GACLC,WAAW,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,kBAAkB,EAAEC,uBAAuB,EACnGC,WAAW,EAAEC,wBAAwB,EAAEC,sCAAsC,EAAEC,gBAAgB,EAC/FC,oBAAoB,EAAEC,+BAA+B,EAAEC,+BAA+B,EACtFC,sBAAsB,EAAEC,6BAA6B,EAAEC,8BAA8B,EACrFC,8BAA8B,EAAEC,qBAAqB,QAC/C,CAAiB;AACxB,MAAM,GAAGC,OAAO,EAAEC,MAAM,QAAQ,CAAe;AAC/C,MAAM,GAAGC,IAAI,QAAQ,CAAoB;AAEzC,MAAM,OAAOC,OAAO;gBACGC,IAAO,CAAE,CAAC;aAAVA,GAAO,GAAPA,IAAO;QADvB,IAoLN,CAlLSC,iBAAiB,IAAIC,IAAQ,GACrCvB,WAAW,CACV,IAAI,CAACqB,GAAG,EAAEE,IAAI;;QAJV,IAoLN,CA9KSC,0BAA0B,IAAID,IAAQ,GAC9Cd,oBAAoB,CACnB,IAAI,CAACY,GAAG,EACR,IAAI,CAACC,iBAAiB,CAACC,IAAI;;QATvB,IAoLN,CAzKSE,kBAAkB,IAAIF,IAAQ,GACtCvB,WAAW,CAAoC,IAAI,CAACqB,GAAG,EAAEE,IAAI;;QAZxD,IAoLN,CAvKSG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C,EAAEnB,oBAAoB;QACrE,CAAC;QA/KK,IAoLN,CAJS+C,OAAO,UAAUd,KAAgB,GAAG,CAAC;YAC7CA,KAAK,CAACC,cAAc;YACpB,IAAI,CAAC/D,WAAW;QACjB,CAAC;IAlL+B,CAAC;;SAoLzB4D,YAAY,CAACiB,MAAe,EAAE,CAAC;IACvC,GAAG,CAAE,GAAG,CAACC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,MAAM,CAACE,MAAM,EAAED,CAAC,GAAI,CAAC;QACxC,KAAK,CAACE,KAAK,GAAGH,MAAM,CAACC,CAAC;QACtBE,KAAK,CAACb,KAAK,GAAG,CAAE;IACjB,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/auth0-ui",
3
- "version": "12.2.9",
3
+ "version": "12.2.13",
4
4
  "description": "ctx-core auth0 ui component & express endpoints",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -26,13 +26,13 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ctx-core/auth0": "^30.0.0",
30
- "@ctx-core/auth0-management": "^9.0.0",
29
+ "@ctx-core/auth0": "^30.0.4",
30
+ "@ctx-core/auth0-management": "^9.0.5",
31
31
  "@ctx-core/dialog": "^19.0.0",
32
32
  "@ctx-core/dialog-ui-svelte": "^1.0.14",
33
33
  "@ctx-core/dom": "^11.1.5",
34
34
  "@ctx-core/error": "^11.3.0",
35
- "@ctx-core/fetch-undici": "^1.1.1",
35
+ "@ctx-core/fetch-undici": "^1.1.3",
36
36
  "@ctx-core/function": "^20.4.0",
37
37
  "@ctx-core/http": "^9.0.22",
38
38
  "@ctx-core/jwt": "^10.0.50",
@@ -53,9 +53,9 @@
53
53
  "@types/trouter": "^3.1.1",
54
54
  "rimraf": "^3.0.2",
55
55
  "svelte": "^3.46.3",
56
- "svelte-check": "^2.4.0",
56
+ "svelte-check": "^2.4.1",
57
57
  "svelte-preprocess": "^4.10.2",
58
- "svelte2tsx": "^0.5.0",
58
+ "svelte2tsx": "^0.5.1",
59
59
  "tslib": "^2.3.1",
60
60
  "typescript": "next"
61
61
  },
@@ -8,7 +8,7 @@ const ctx = getContext_auth0_ui_ctx()
8
8
  const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_(ctx)
9
9
  const auth0_token_error$ = auth0_token_error$_(ctx)
10
10
  const _ = new Auth0_c(ctx)
11
- let email_input:HTMLInputElement, error:string
11
+ let email_input:HTMLInputElement, error:typeof $auth0_token_error$?.error
12
12
  $: error = $auth0_token_error$?.error
13
13
  </script>
14
14
 
package/src/ui/Auth0_c.ts CHANGED
@@ -5,7 +5,7 @@ import type {
5
5
  post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T, signup_data_I
6
6
  } from '@ctx-core/auth0'
7
7
  import {
8
- auth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error_,
8
+ auth0_body_, auth0_opened_class$_, auth0_token_error$_, auth0_token_json$_, clear_auth0_token_error,
9
9
  close_auth0, logout_auth0_token_error, open_auth0_forgot_password_check_email, open_auth0_login,
10
10
  password_realm_body_, post_auth0_auth_change_password, post_auth0_dbconnections_signup,
11
11
  post_auth0_oauth_token, post_auth0_passwordless_start, validate_auth0_change_password,
@@ -32,7 +32,6 @@ export class Auth0_c {
32
32
  readonly auth0_opened_class = auth0_opened_class$_(this.ctx)
33
33
  readonly auth0_token_json$ = auth0_token_json$_(this.ctx)
34
34
  readonly auth0_token_error$ = auth0_token_error$_(this.ctx)
35
- readonly clear_auth0_token_error = clear_auth0_token_error_(this.ctx)
36
35
  readonly close_auth0 = ()=>close_auth0(this.ctx)
37
36
  readonly onMount = async (root:HTMLElement)=>{
38
37
  if (has_dom) {
@@ -112,7 +111,7 @@ export class Auth0_c {
112
111
  }
113
112
  readonly schedule_forms_clear = (root:HTMLElement)=>{
114
113
  setTimeout(()=>{
115
- this.clear_auth0_token_error()
114
+ clear_auth0_token_error(this.ctx)
116
115
  clear_inputs(dom_a_('input[type=text]', root))
117
116
  clear_inputs(dom_a_('input[type=password]', root))
118
117
  }, 100)