@ctx-core/auth0-ui 10.0.123 → 11.0.1
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 +26 -0
- package/dist/auth0_ui_ctx_I.generated.js.map +1 -1
- package/dist/ui/Auth0.svelte +5 -6
- package/dist/ui/Auth0_Change_Password_Form.svelte +17 -24
- package/dist/ui/Auth0_Dialog_Close.svelte +2 -2
- package/dist/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
- package/dist/ui/Auth0_Forgot_Password_Form.svelte +10 -14
- package/dist/ui/Auth0_Loggedin_If.svelte +1 -1
- package/dist/ui/Auth0_Login_Form.svelte +25 -29
- package/dist/ui/Auth0_Signup_Form.svelte +34 -35
- package/dist/ui/Auth0_c.js +8 -8
- package/dist/ui/Auth0_c.js.map +1 -1
- package/package.json +11 -6
- 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/node/index.js +0 -8
- package/dist/node/index.js.map +0 -1
- package/dist/node/jwks_cert__b.js +0 -19
- package/dist/node/jwks_cert__b.js.map +0 -1
- package/dist/node/jwks_x5c__b.js +0 -21
- package/dist/node/jwks_x5c__b.js.map +0 -1
- package/dist/node/jwt_token_decoded__b.js +0 -15
- package/dist/node/jwt_token_decoded__b.js.map +0 -1
- package/dist/node/koa_jwt_token_decoded__b.js +0 -18
- package/dist/node/koa_jwt_token_decoded__b.js.map +0 -1
- package/dist/node/verify_jwt_email__b.js +0 -29
- package/dist/node/verify_jwt_email__b.js.map +0 -1
- package/dist/node/verify_jwt_user_id__b.js +0 -15
- package/dist/node/verify_jwt_user_id__b.js.map +0 -1
- 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/ui/Auth0_c.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/Auth0_c.ts"],"sourcesContent":["import { onDestroy } from 'svelte'\nimport { has_dom, dom_a_ } from '@ctx-core/dom'\nimport { subscribe } from '@ctx-core/store'\nimport {\n\tauth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,\n\tclose_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,\n\tpassword_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,\n\tpost_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password,\n\tvalidate_auth0_forgot_password, validate_auth0_signup\n} from '@ctx-core/auth0'\nimport type {\n\tauth0_body__T, auth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, logout_auth0_token_error_T,\n\topen_auth0_forgot_password_check_email_T, open_auth0_login_T, password_realm_body__T, password_realm_body_T,\n\tpost_auth0_auth_change_password_T, post_auth0_dbconnections_signup_T, post_auth0_oauth_token_body_I,\n\tpost_auth0_oauth_token_T, post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T,\n\tpost_auth0_passwordless_start_T, signup_data_I\n} from '@ctx-core/auth0'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nexport class Auth0_c {\n\tconstructor(protected ctx:auth0_ui_Ctx) {}\n\treadonly login_auth0_body_ = auth0_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'login_auth0_body_',\n\t\tlogin_data_password_realm_body_I\n\t/*@formatter:on*/>(this.ctx, 'login_auth0_body_')\n\treadonly login_password_realm_body_ = password_realm_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'login_password_realm_body_',\n\t\tlogin_data_password_realm_body_I\n/*@formatter:on*/>(\n\t\tthis.ctx,\n\t\t'login_password_realm_body_',\n\t\tthis.login_auth0_body_\n\t)\n\treadonly signup_auth0_body_:auth0_body__T<signup_data_password_realm_body_I> = auth0_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'signup_auth0_body_',\n\t\tsignup_data_password_realm_body_I\n\t/*@formatter:on*/>(this.ctx, 'signup_auth0_body_')\n\treadonly signup_password_realm_body_:password_realm_body__T<signup_data_password_realm_body_I> = password_realm_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'signup_password_realm_body_fn',\n\t\tsignup_data_password_realm_body_I\n\t/*@formatter:on*/>(\n\t\tthis.ctx, 'signup_password_realm_body_fn', this.signup_auth0_body_\n\t)\n\treadonly auth0_opened_class = auth0_opened_class$_b(this.ctx)\n\treadonly auth0_token_json$ = auth0_token_json$_b(this.ctx)\n\treadonly auth0_token_error = auth0_token_error$_b(this.ctx)\n\treadonly clear_auth0_token_error = clear_auth0_token_error_b(this.ctx)\n\treadonly close_auth0 = close_auth0_b(this.ctx)\n\treadonly logout_auth0_token_error:logout_auth0_token_error_T = logout_auth0_token_error_b(this.ctx)\n\treadonly open_auth0_login:open_auth0_login_T = open_auth0_login_b(this.ctx)\n\treadonly open_auth0_forgot_password_check_email:open_auth0_forgot_password_check_email_T = open_auth0_forgot_password_check_email_b(this.ctx)\n\treadonly post_auth0_dbconnections_signup:post_auth0_dbconnections_signup_T = post_auth0_dbconnections_signup_b(this.ctx)\n\treadonly post_auth0_oauth_token:post_auth0_oauth_token_T = post_auth0_oauth_token_b(this.ctx)\n\treadonly post_auth0_auth_change_password:post_auth0_auth_change_password_T = post_auth0_auth_change_password_b(this.ctx)\n\treadonly post_auth0_passwordless_start:post_auth0_passwordless_start_T = post_auth0_passwordless_start_b(this.ctx)\n\treadonly onMount = async (root:HTMLElement)=>{\n\t\tif (has_dom) {\n\t\t\tconst unsubscribe =\n\t\t\t\tsubscribe(this.auth0_opened_class, ()=>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 response = await this.post_auth0_oauth_token(\n\t\t\tthis.login_password_realm_body_(data)\n\t\t)\n\t\tif (response.ok) {\n\t\t\tconst auth0_token_json = await response.text()\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 = await response.json()\n\t\t\tthis.auth0_token_error.$ = $auth_token_error\n\t\t\tthis.logout_auth0_token_error($auth_token_error)\n\t\t}\n\t}\n\treadonly signup = async (data:signup_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst response = await this.post_auth0_dbconnections_signup(this.signup_password_realm_body_(data))\n\t\tconst auth0_userinfo = await response.json()\n\t\tconst { statusCode } = auth0_userinfo\n\t\tif (statusCode) {\n\t\t\tconst {\n\t\t\t\tcode,\n\t\t\t\tdescription\n\t\t\t} = auth0_userinfo\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\tthis.logout_auth0_token_error(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 = await this.post_auth0_auth_change_password(password)\n\t\t\tconst response_json = await response.json()\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status == 401) {\n\t\t\t\t\tthis.open_auth0_login()\n\t\t\t\t\tconst auth0_token_error = { email: 'Authentication Error - Log in' }\n\t\t\t\t\tthis.logout_auth0_token_error(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\tthis.logout_auth0_token_error(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\tthis.logout_auth0_token_error(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\tthis.logout_auth0_token_error(auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tawait this.post_auth0_passwordless_start(\n\t\t\tthis.login_auth0_body_(data) as post_auth0_passwordless_start_body_T\n\t\t)\n\t\tthis.open_auth0_forgot_password_check_email()\n\t}\n\treadonly onsubmit_change_password = async (\n\t\tevent:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = ()=>{}\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\tthis.logout_auth0_token_error(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","has_dom","dom_a_","subscribe","auth0_body__b","auth0_opened_class$_b","auth0_token_error$_b","auth0_token_json$_b","clear_auth0_token_error_b","close_auth0_b","logout_auth0_token_error_b","open_auth0_forgot_password_check_email_b","open_auth0_login_b","password_realm_body__b","post_auth0_auth_change_password_b","post_auth0_dbconnections_signup_b","post_auth0_oauth_token_b","post_auth0_passwordless_start_b","validate_auth0_change_password","validate_auth0_forgot_password","validate_auth0_signup","Auth0_c","login_auth0_body_","ctx","login_password_realm_body_","signup_auth0_body_","signup_password_realm_body_","auth0_opened_class","auth0_token_json$","auth0_token_error","clear_auth0_token_error","close_auth0","logout_auth0_token_error","open_auth0_login","open_auth0_forgot_password_check_email","post_auth0_dbconnections_signup","post_auth0_oauth_token","post_auth0_auth_change_password","post_auth0_passwordless_start","onMount","root","unsubscribe","schedule_forms_clear","login","data","response","ok","auth0_token_json","text","$","$auth_token_error","json","signup","auth0_userinfo","statusCode","code","description","email","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":"AAAA,MAAM,GAAGA,SAAS,QAAQ,CAAQ;AAClC,MAAM,GAAGC,OAAO,EAAEC,MAAM,QAAQ,CAAe;AAC/C,MAAM,GAAGC,SAAS,QAAQ,CAAiB;AAC3C,MAAM,GACLC,aAAa,EAAEC,qBAAqB,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,yBAAyB,EAC1GC,aAAa,EAAEC,0BAA0B,EAAEC,wCAAwC,EAAEC,kBAAkB,EACvGC,sBAAsB,EAAEC,iCAAiC,EAAEC,iCAAiC,EAC5FC,wBAAwB,EAAEC,+BAA+B,EAAEC,8BAA8B,EACzFC,8BAA8B,EAAEC,qBAAqB,QAC/C,CAAiB;AASxB,MAAM,OAAOC,OAAO;gBACG,IAAgB,CAAE,CAAC;aAAnB,GAAgB,GAAhB,IAAgB;QADhC,IAwMN,CAtMSC,iBAAiB,GAAGlB,aAAa,CAIvB,IAAI,CAACmB,GAAG,EAAE,CAAmB;QAN1C,IAwMN,CAjMSC,0BAA0B,GAAGX,sBAAsB,CAK3D,IAAI,CAACU,GAAG,EACR,CAA4B,6BAC5B,IAAI,CAACD,iBAAiB;QAdjB,IAwMN,CAxLSG,kBAAkB,GAAoDrB,aAAa,CAIzE,IAAI,CAACmB,GAAG,EAAE,CAAoB;QApB3C,IAwMN,CAnLSG,2BAA2B,GAA6Db,sBAAsB,CAKtH,IAAI,CAACU,GAAG,EAAE,CAA+B,gCAAE,IAAI,CAACE,kBAAkB;QA1B7D,IAwMN,CA5KSE,kBAAkB,GAAGtB,qBAAqB,CAAC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qB,GAAGF,2BAA2B,CAACC,KAAK;YAC/D,KAAK,CAACjD,iBAAiB,GACtBX,8BAA8B,CAC7B,CAAC;gBACAyC,QAAQ;gBACRoB,qBAAqB;YACtB,CAAC;YACH,EAAE,EAAElD,iBAAiB,EAAE,CAAC;gBACvB,IAAI,CAACG,wBAAwB,CAACH,iBAAiB;gBAC/C,KAAK,CAACA,iBAAiB;YACxB,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC+B,eAAe,CAAC,CAAC;gBAACD,QAAQ;YAAC,CAAC,EAAEjB,oBAAoB;QACrE,CAAC;QAnMK,IAwMN,CAJS6C,OAAO,UAAUd,KAAgB,GAAG,CAAC;YAC7CA,KAAK,CAACC,cAAc;YACpB,IAAI,CAAC3C,WAAW;QACjB,CAAC;IAtMwC,CAAC;;SAwMlCwC,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 { onDestroy } from 'svelte'\nimport type {\n\tauth0_body__T, auth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, logout_auth0_token_error_T,\n\topen_auth0_forgot_password_check_email_T, open_auth0_login_T, password_realm_body__T, password_realm_body_T,\n\tpost_auth0_auth_change_password_T, post_auth0_dbconnections_signup_T, post_auth0_oauth_token_body_I,\n\tpost_auth0_oauth_token_T, post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T,\n\tpost_auth0_passwordless_start_T, signup_data_I\n} from '@ctx-core/auth0'\nimport {\n\tauth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,\n\tclose_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,\n\tpassword_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,\n\tpost_auth0_oauth_token_b, post_auth0_passwordless_start_b, 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 { subscribe } from '@ctx-core/store'\nimport type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'\nexport class Auth0_c {\n\tconstructor(protected ctx:auth0_ui_Ctx) {}\n\treadonly login_auth0_body_ = auth0_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'login_auth0_body_',\n\t\tlogin_data_password_realm_body_I\n\t/*@formatter:on*/>(this.ctx, 'login_auth0_body_')\n\treadonly login_password_realm_body_ = password_realm_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'login_password_realm_body_',\n\t\tlogin_data_password_realm_body_I\n/*@formatter:on*/>(\n\t\tthis.ctx,\n\t\t'login_password_realm_body_',\n\t\tthis.login_auth0_body_\n\t)\n\treadonly signup_auth0_body_:auth0_body__T<signup_data_password_realm_body_I> = auth0_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'signup_auth0_body_',\n\t\tsignup_data_password_realm_body_I\n\t/*@formatter:on*/>(this.ctx, 'signup_auth0_body_')\n\treadonly signup_password_realm_body_:password_realm_body__T<signup_data_password_realm_body_I> = password_realm_body__b</*@formatter:off*/\n\t\tauth0_ui_Ctx,\n\t\t'signup_password_realm_body_fn',\n\t\tsignup_data_password_realm_body_I\n\t/*@formatter:on*/>(\n\t\tthis.ctx, 'signup_password_realm_body_fn', this.signup_auth0_body_\n\t)\n\treadonly auth0_opened_class = auth0_opened_class$_b(this.ctx)\n\treadonly auth0_token_json$ = auth0_token_json$_b(this.ctx)\n\treadonly auth0_token_error = auth0_token_error$_b(this.ctx)\n\treadonly clear_auth0_token_error = clear_auth0_token_error_b(this.ctx)\n\treadonly close_auth0 = close_auth0_b(this.ctx)\n\treadonly logout_auth0_token_error:logout_auth0_token_error_T = logout_auth0_token_error_b(this.ctx)\n\treadonly open_auth0_login:open_auth0_login_T = open_auth0_login_b(this.ctx)\n\treadonly open_auth0_forgot_password_check_email:open_auth0_forgot_password_check_email_T = open_auth0_forgot_password_check_email_b(this.ctx)\n\treadonly post_auth0_dbconnections_signup:post_auth0_dbconnections_signup_T = post_auth0_dbconnections_signup_b(this.ctx)\n\treadonly post_auth0_oauth_token:post_auth0_oauth_token_T = post_auth0_oauth_token_b(this.ctx)\n\treadonly post_auth0_auth_change_password:post_auth0_auth_change_password_T = post_auth0_auth_change_password_b(this.ctx)\n\treadonly post_auth0_passwordless_start:post_auth0_passwordless_start_T = post_auth0_passwordless_start_b(this.ctx)\n\treadonly onMount = async (root:HTMLElement)=>{\n\t\tif (has_dom) {\n\t\t\tconst unsubscribe =\n\t\t\t\tsubscribe(this.auth0_opened_class, ()=>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 response = await this.post_auth0_oauth_token(\n\t\t\tthis.login_password_realm_body_(data)\n\t\t)\n\t\tif (response.ok) {\n\t\t\tconst auth0_token_json = await response.text()\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 = await response.json()\n\t\t\tthis.auth0_token_error.$ = $auth_token_error\n\t\t\tthis.logout_auth0_token_error($auth_token_error)\n\t\t}\n\t}\n\treadonly signup = async (data:signup_data_I, schedule_forms_clear = ()=>{})=>{\n\t\tconst response = await this.post_auth0_dbconnections_signup(this.signup_password_realm_body_(data))\n\t\tconst auth0_userinfo = await response.json()\n\t\tconst { statusCode } = auth0_userinfo\n\t\tif (statusCode) {\n\t\t\tconst {\n\t\t\t\tcode,\n\t\t\t\tdescription\n\t\t\t} = auth0_userinfo\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\tthis.logout_auth0_token_error(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.username,\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 = await this.post_auth0_auth_change_password(password)\n\t\t\tconst response_json = await response.json()\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status == 401) {\n\t\t\t\t\tthis.open_auth0_login()\n\t\t\t\t\tconst auth0_token_error = { username: 'Authentication Error - Log in' }\n\t\t\t\t\tthis.logout_auth0_token_error(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\tthis.logout_auth0_token_error(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 username = 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\tusername,\n\t\t\t\tpassword,\n\t\t\t\tpassword_confirmation\n\t\t\t})\n\t\tif (auth0_token_error) {\n\t\t\tthis.logout_auth0_token_error(auth0_token_error)\n\t\t\treturn false\n\t\t}\n\t\tawait this.signup({\n\t\t\tusername,\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\tthis.logout_auth0_token_error(auth0_token_error)\n\t\t\treturn\n\t\t}\n\t\tawait this.post_auth0_passwordless_start(\n\t\t\tthis.login_auth0_body_(data) as post_auth0_passwordless_start_body_T\n\t\t)\n\t\tthis.open_auth0_forgot_password_check_email()\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\tthis.logout_auth0_token_error(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__b","auth0_opened_class$_b","auth0_token_error$_b","auth0_token_json$_b","clear_auth0_token_error_b","close_auth0_b","logout_auth0_token_error_b","open_auth0_forgot_password_check_email_b","open_auth0_login_b","password_realm_body__b","post_auth0_auth_change_password_b","post_auth0_dbconnections_signup_b","post_auth0_oauth_token_b","post_auth0_passwordless_start_b","validate_auth0_change_password","validate_auth0_forgot_password","validate_auth0_signup","has_dom","dom_a_","noop","subscribe","Auth0_c","login_auth0_body_","ctx","login_password_realm_body_","signup_auth0_body_","signup_password_realm_body_","auth0_opened_class","auth0_token_json$","auth0_token_error","clear_auth0_token_error","close_auth0","logout_auth0_token_error","open_auth0_login","open_auth0_forgot_password_check_email","post_auth0_dbconnections_signup","post_auth0_oauth_token","post_auth0_auth_change_password","post_auth0_passwordless_start","onMount","root","unsubscribe","schedule_forms_clear","login","data","response","ok","auth0_token_json","text","$","$auth_token_error","json","signup","auth0_userinfo","statusCode","code","description","email","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":"AAAA,MAAM,GAAGA,SAAS,QAAQ,CAAQ;AAQlC,MAAM,GACLC,aAAa,EAAEC,qBAAqB,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,yBAAyB,EAC1GC,aAAa,EAAEC,0BAA0B,EAAEC,wCAAwC,EAAEC,kBAAkB,EACvGC,sBAAsB,EAAEC,iCAAiC,EAAEC,iCAAiC,EAC5FC,wBAAwB,EAAEC,+BAA+B,EAAEC,8BAA8B,EACzFC,8BAA8B,EAAEC,qBAAqB,QAC/C,CAAiB;AACxB,MAAM,GAAGC,OAAO,EAAEC,MAAM,QAAQ,CAAe;AAC/C,MAAM,GAAGC,IAAI,QAAQ,CAAoB;AACzC,MAAM,GAAGC,SAAS,QAAQ,CAAiB;AAE3C,MAAM,OAAOC,OAAO;gBACG,IAAgB,CAAE,CAAC;aAAnB,GAAgB,GAAh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C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/auth0-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "ctx-core auth0 ui component & express endpoints",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -29,25 +29,30 @@
|
|
|
29
29
|
},
|
|
30
30
|
"browser": "./dist/index.browser.js",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ctx-core/auth0": "^
|
|
33
|
-
"@ctx-core/auth0-management": "^6.0.
|
|
32
|
+
"@ctx-core/auth0": "^26.0.0",
|
|
33
|
+
"@ctx-core/auth0-management": "^6.0.102",
|
|
34
34
|
"@ctx-core/dialog": "^15.0.78",
|
|
35
35
|
"@ctx-core/dom": "^11.0.30",
|
|
36
36
|
"@ctx-core/error": "^11.0.18",
|
|
37
37
|
"@ctx-core/fetch": "^11.0.80",
|
|
38
|
-
"@ctx-core/
|
|
38
|
+
"@ctx-core/function": "^20.2.3",
|
|
39
|
+
"@ctx-core/http": "^9.0.0",
|
|
40
|
+
"@ctx-core/jwt": "^10.0.28",
|
|
41
|
+
"@ctx-core/logger": "^9.0.19",
|
|
39
42
|
"@ctx-core/object": "^21.0.22",
|
|
40
43
|
"@ctx-core/store": "^27.0.36",
|
|
44
|
+
"auth0-js": "^9.18.0",
|
|
41
45
|
"jsonwebtoken": "^8.5.1",
|
|
42
|
-
"
|
|
46
|
+
"polka": "^0.5.2"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
49
|
"@ctx-core/ctx-core-package-tools": "^8.0.77",
|
|
46
50
|
"@ctx-core/dev-tools": "^7.2.0",
|
|
47
|
-
"@ctx-core/function": "^20.2.3",
|
|
48
51
|
"@swc/cli": "^0.1.51",
|
|
49
52
|
"@swc/core": "^1.2.107",
|
|
50
53
|
"@types/jsonwebtoken": "^8.5.5",
|
|
54
|
+
"@types/polka": "^0.5.3",
|
|
55
|
+
"svelte": "3.44.1",
|
|
51
56
|
"typescript": "^4.4.4"
|
|
52
57
|
},
|
|
53
58
|
"publishConfig": {
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* This file was generated by `npm run generate_ctx_I_file` in @ctx-core/dev-tools
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
import type { jwks_x5c__T } from './node/jwks_x5c__b.js'
|
|
6
|
-
import type { jwt_token_decoded__T } from './node/jwt_token_decoded__b.js'
|
|
7
|
-
import type { koa_jwt_token_decoded__T } from './node/koa_jwt_token_decoded__b.js'
|
|
8
|
-
import type { verify_jwt_email__T } from './node/verify_jwt_email__b.js'
|
|
9
|
-
import type { verify_jwt_user_id__T } from './node/verify_jwt_user_id__b.js'
|
|
4
|
+
|
|
10
5
|
export interface auth0_ui_ctx_I {
|
|
11
|
-
|
|
12
|
-
jwks_x5c_?:jwks_x5c__T
|
|
13
|
-
jwt_token_decoded_?:jwt_token_decoded__T
|
|
14
|
-
koa_jwt_token_decoded_?:koa_jwt_token_decoded__T
|
|
15
|
-
verify_jwt_email_?:verify_jwt_email__T
|
|
16
|
-
verify_jwt_user_id_?:verify_jwt_user_id__T
|
|
6
|
+
|
|
17
7
|
}
|
package/src/ui/Auth0.svelte
CHANGED
|
@@ -4,17 +4,16 @@ import {
|
|
|
4
4
|
auth0_forgot_password_opened$_b, auth0_opened_class$_b, auth0_login_opened$_b, auth0_signup_opened$_b,
|
|
5
5
|
auth0_forgot_password_check_email_opened$_b, auth0_change_password_opened$_b
|
|
6
6
|
} from '@ctx-core/auth0'
|
|
7
|
-
import { auth0_ui_ctx_key } from '../auth0_ui_ctx_key.js'
|
|
8
7
|
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
8
|
+
import { auth0_ui_ctx_key } from '../auth0_ui_ctx_key.js'
|
|
9
9
|
import { Auth0_c } from './Auth0_c.js'
|
|
10
10
|
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
11
|
-
import Auth0_Login_Form from './Auth0_Login_Form.svelte'
|
|
12
|
-
import Auth0_Signup_Form from './Auth0_Signup_Form.svelte'
|
|
13
|
-
import Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte'
|
|
14
11
|
import Auth0_Forgot_Password_Check_Email_Form from './Auth0_Forgot_Password_Check_Email_Form.svelte'
|
|
15
12
|
import Auth0_Change_Password_Form from './Auth0_Change_Password_Form.svelte'
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte'
|
|
14
|
+
import Auth0_Login_Form from './Auth0_Login_Form.svelte'
|
|
15
|
+
import Auth0_Signup_Form from './Auth0_Signup_Form.svelte'
|
|
16
|
+
export let ctx = {} as auth0_ui_Ctx, dialog = false
|
|
18
17
|
setContext(auth0_ui_ctx_key, ctx)
|
|
19
18
|
const auth0_change_password_opened$ = auth0_change_password_opened$_b(ctx)
|
|
20
19
|
const auth0_opened_class$ = auth0_opened_class$_b(ctx)
|
|
@@ -7,31 +7,24 @@ import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
|
7
7
|
import { Auth0_c } from './Auth0_c.js'
|
|
8
8
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
9
9
|
const dispatch = createEventDispatcher()
|
|
10
|
-
export let error_class = ''
|
|
11
|
-
export let input_class = ''
|
|
12
|
-
export let button_class = ''
|
|
13
|
-
export let label_class = '.js'
|
|
10
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
14
11
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
15
12
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
16
13
|
const _ = new Auth0_c(ctx)
|
|
17
|
-
let root
|
|
18
|
-
let password_input
|
|
14
|
+
let root:HTMLDivElement
|
|
15
|
+
let password_input:HTMLInputElement
|
|
19
16
|
let password_confirmation_input
|
|
20
|
-
let password_error //region
|
|
21
|
-
$: password_error =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$: password_error_confirmation =
|
|
26
|
-
$auth0_token_error$
|
|
27
|
-
&& $auth0_token_error$.password_confirmation //endregion
|
|
28
|
-
async function in_onsubmit_change_password(event) {
|
|
17
|
+
let password_error:any|undefined //region
|
|
18
|
+
$: password_error = $auth0_token_error$?.password //endregion
|
|
19
|
+
let password_error_confirmation:string|undefined //region
|
|
20
|
+
$: password_error_confirmation = $auth0_token_error$?.password_confirmation //endregion
|
|
21
|
+
async function onsubmit_change_password(event:FormDataEvent) {
|
|
29
22
|
dispatch('submit__start')
|
|
30
23
|
try {
|
|
31
24
|
await _.onsubmit_change_password(event, {
|
|
32
25
|
password_input,
|
|
33
26
|
password_confirmation_input,
|
|
34
|
-
}, _.
|
|
27
|
+
}, ()=>_.schedule_forms_clear(root))
|
|
35
28
|
dispatch('success')
|
|
36
29
|
} catch (error) {
|
|
37
30
|
dispatch('error', { error })
|
|
@@ -42,14 +35,14 @@ async function in_onsubmit_change_password(event) {
|
|
|
42
35
|
}
|
|
43
36
|
</script>
|
|
44
37
|
|
|
45
|
-
<div bind:this=
|
|
38
|
+
<div bind:this={root} class="form change_password Auth0_Change_Password_Form">
|
|
46
39
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
47
40
|
<h1>Change Password</h1>
|
|
48
41
|
<form
|
|
49
42
|
action="https://{$AUTH0_DOMAIN$}/dbconnections/change_password"
|
|
50
43
|
accept-charset="UTF-8"
|
|
51
44
|
method="post"
|
|
52
|
-
on:submit|preventDefault=
|
|
45
|
+
on:submit|preventDefault={onsubmit_change_password}
|
|
53
46
|
>
|
|
54
47
|
{#if $auth0_token_error$}
|
|
55
48
|
<ul>
|
|
@@ -67,26 +60,26 @@ async function in_onsubmit_change_password(event) {
|
|
|
67
60
|
{/if}
|
|
68
61
|
<fieldset>
|
|
69
62
|
<label class="field">
|
|
70
|
-
<div class=
|
|
63
|
+
<div class={label_class}>Password</div>
|
|
71
64
|
<input
|
|
72
65
|
bind:this={password_input}
|
|
73
66
|
placeholder="**********"
|
|
74
67
|
required="required"
|
|
75
|
-
class=
|
|
76
|
-
class:invalid=
|
|
68
|
+
class={input_class}
|
|
69
|
+
class:invalid={password_error}
|
|
77
70
|
id="password-change_password"
|
|
78
71
|
type="password"
|
|
79
72
|
name="password"/>
|
|
80
73
|
</label>
|
|
81
74
|
<label class="field">
|
|
82
|
-
<div class=
|
|
75
|
+
<div class={label_class}>Confirm Password</div>
|
|
83
76
|
<input
|
|
84
77
|
bind:this={password_confirmation_input}
|
|
85
78
|
type="password"
|
|
86
79
|
id="password_confirmation-change_password"
|
|
87
80
|
name="password_confirmation"
|
|
88
|
-
class=
|
|
89
|
-
class:invalid=
|
|
81
|
+
class={input_class}
|
|
82
|
+
class:invalid={password_error_confirmation}
|
|
90
83
|
required="required"
|
|
91
84
|
placeholder="**********"
|
|
92
85
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { CloseDialogHandle } from '@ctx-core/dialog'
|
|
3
|
-
import {
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
4
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
5
|
-
import
|
|
5
|
+
import { Auth0_c } from './Auth0_c.js'
|
|
6
6
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
7
7
|
const _ = new Auth0_c(ctx)
|
|
8
8
|
</script>
|
|
@@ -3,7 +3,7 @@ import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
|
3
3
|
let root:HTMLDivElement
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div bind:this=
|
|
6
|
+
<div bind:this={root} class="form forgot_password_check_email">
|
|
7
7
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
8
8
|
<h1>Check Your Email</h1>
|
|
9
9
|
<p>An email to reset you password has been sent to you.</p>
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { AUTH0_DOMAIN$_b, auth0_token_error$_b, open_auth0_login_b, open_auth0_signup_b } from '@ctx-core/auth0'
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
6
5
|
import { Auth0_c } from './Auth0_c.js'
|
|
7
|
-
|
|
8
|
-
export let input_class = ''
|
|
9
|
-
export let button_class = ''
|
|
10
|
-
export let label_class = '.js'
|
|
6
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
7
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
11
8
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
12
9
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
13
10
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
14
11
|
const open_auth0_login = open_auth0_login_b(ctx)
|
|
15
12
|
const open_auth0_signup = open_auth0_signup_b(ctx)
|
|
16
13
|
const _ = new Auth0_c(ctx)
|
|
17
|
-
let email_input
|
|
18
|
-
|
|
19
|
-
$: email_error = $auth0_token_error$?.email
|
|
14
|
+
let email_input:HTMLInputElement, error:string
|
|
15
|
+
$: error = $auth0_token_error$?.error
|
|
20
16
|
</script>
|
|
21
17
|
|
|
22
18
|
<div class="form forgot_password">
|
|
@@ -26,7 +22,7 @@ $: email_error = $auth0_token_error$?.email
|
|
|
26
22
|
action="https://{$AUTH0_DOMAIN$}/passwordless/start"
|
|
27
23
|
accept-charset="UTF-8"
|
|
28
24
|
method="post"
|
|
29
|
-
on:submit=
|
|
25
|
+
on:submit={event => _.onsubmit_forgot_password(event, { email_input })}
|
|
30
26
|
>
|
|
31
27
|
{#if $auth0_token_error$}
|
|
32
28
|
<ul>
|
|
@@ -37,13 +33,13 @@ $: email_error = $auth0_token_error$?.email
|
|
|
37
33
|
{/if}
|
|
38
34
|
<fieldset>
|
|
39
35
|
<label class="field">
|
|
40
|
-
<div class=
|
|
36
|
+
<div class={label_class}>Email</div>
|
|
41
37
|
<input
|
|
42
38
|
bind:this={email_input}
|
|
43
39
|
placeholder="your@email.com"
|
|
44
40
|
required="required"
|
|
45
41
|
class="form-control {input_class}"
|
|
46
|
-
class:invalid=
|
|
42
|
+
class:invalid={error}
|
|
47
43
|
type="email"
|
|
48
44
|
id="email-forgot_password"
|
|
49
45
|
name="email"/>
|
|
@@ -57,11 +53,11 @@ $: email_error = $auth0_token_error$?.email
|
|
|
57
53
|
/>
|
|
58
54
|
<label
|
|
59
55
|
class="navigation__auth {label_class}"
|
|
60
|
-
on:click=
|
|
56
|
+
on:click={open_auth0_login}
|
|
61
57
|
>Have an account? Log in…</label>
|
|
62
58
|
<label
|
|
63
59
|
class="navigation__auth {label_class}"
|
|
64
|
-
on:click=
|
|
60
|
+
on:click={open_auth0_signup}
|
|
65
61
|
>Don't have an account? Signup…</label>
|
|
66
62
|
</footer>
|
|
67
63
|
</form>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { is_auth0_loggedin$_b, is_auth0_loggedout$_b, } from '@ctx-core/auth0'
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
5
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
6
6
|
const is_auth0_loggedin$ = is_auth0_loggedin$_b(ctx)
|
|
7
7
|
const is_auth0_loggedout$ = is_auth0_loggedout$_b(ctx)
|
|
@@ -1,70 +1,66 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {
|
|
3
|
-
AUTH0_DOMAIN$_b, auth0_token_error$_b,
|
|
3
|
+
AUTH0_DOMAIN$_b, auth0_token_error$_b, auth0_token_error_txt$_b, open_auth0_forgot_password_b, open_auth0_signup_b
|
|
4
4
|
} from '@ctx-core/auth0'
|
|
5
5
|
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
6
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
7
6
|
import { Auth0_c } from './Auth0_c.js'
|
|
8
|
-
|
|
9
|
-
export let error_class = ''
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export let label_class = '.js'
|
|
13
|
-
const auth0_token_error = auth0_token_error$_b(ctx)
|
|
14
|
-
const auth0_token_error_txt = auth0_token_error_txt_b(ctx)
|
|
7
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
8
|
+
export let ctx:auth0_ui_Ctx, error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
9
|
+
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
10
|
+
const auth0_token_error_txt$ = auth0_token_error_txt$_b(ctx)
|
|
15
11
|
const AUTH0_DOMAIN = AUTH0_DOMAIN$_b(ctx)
|
|
16
12
|
const open_auth0_signup = open_auth0_signup_b(ctx)
|
|
17
13
|
const open_auth0_forgot_password = open_auth0_forgot_password_b(ctx)
|
|
18
14
|
const _ = new Auth0_c(ctx)
|
|
19
|
-
let root
|
|
20
|
-
let username_login_input, password_login_input
|
|
21
|
-
let
|
|
22
|
-
$:
|
|
23
|
-
let
|
|
24
|
-
$:
|
|
15
|
+
let root:HTMLDivElement
|
|
16
|
+
let username_login_input:HTMLInputElement, password_login_input:HTMLInputElement
|
|
17
|
+
let error_username:string|undefined//region
|
|
18
|
+
$: error_username = $auth0_token_error$?.username //endregion
|
|
19
|
+
let error_password:string|undefined//region
|
|
20
|
+
$: error_password = $auth0_token_error$?.password //endregion
|
|
25
21
|
</script>
|
|
26
22
|
|
|
27
|
-
<div bind:this=
|
|
23
|
+
<div bind:this={root} class="form {$$props.class||''}">
|
|
28
24
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
29
25
|
<h1><slot name="login_text">Welcome</slot></h1>
|
|
30
26
|
<form
|
|
31
27
|
action="https://{$AUTH0_DOMAIN}/oauth/token"
|
|
32
28
|
accept-charset="UTF-8"
|
|
33
29
|
method="post"
|
|
34
|
-
on:submit=
|
|
30
|
+
on:submit={event =>
|
|
35
31
|
_.onsubmit_login(event, {
|
|
36
32
|
username_login_input,
|
|
37
33
|
password_login_input
|
|
38
|
-
}, _.
|
|
34
|
+
}, ()=>_.schedule_forms_clear(root))}
|
|
39
35
|
>
|
|
40
|
-
{#if $auth0_token_error_txt}
|
|
36
|
+
{#if $auth0_token_error_txt$}
|
|
41
37
|
<ul>
|
|
42
38
|
<li class="error {error_class}">
|
|
43
|
-
{$auth0_token_error_txt}
|
|
39
|
+
{$auth0_token_error_txt$}
|
|
44
40
|
</li>
|
|
45
41
|
</ul>
|
|
46
42
|
{/if}
|
|
47
43
|
<fieldset>
|
|
48
44
|
<label class="field">
|
|
49
|
-
<div class=
|
|
45
|
+
<div class={label_class}>Email</div>
|
|
50
46
|
<input
|
|
51
|
-
bind:this=
|
|
47
|
+
bind:this={username_login_input}
|
|
52
48
|
placeholder="your@email.com"
|
|
53
49
|
required="required"
|
|
54
50
|
class="form-control {input_class}"
|
|
55
|
-
class:invalid=
|
|
51
|
+
class:invalid={error_username}
|
|
56
52
|
type="email"
|
|
57
53
|
id="username-login"
|
|
58
54
|
name="username"/>
|
|
59
55
|
</label>
|
|
60
56
|
<label class="field">
|
|
61
|
-
<div class=
|
|
57
|
+
<div class={label_class}>Password</div>
|
|
62
58
|
<input
|
|
63
|
-
bind:this=
|
|
59
|
+
bind:this={password_login_input}
|
|
64
60
|
placeholder="**********"
|
|
65
61
|
required="required"
|
|
66
|
-
class=
|
|
67
|
-
class:invalid=
|
|
62
|
+
class={input_class}
|
|
63
|
+
class:invalid={error_password}
|
|
68
64
|
id="password-login"
|
|
69
65
|
type="password"
|
|
70
66
|
name="password"/>
|
|
@@ -78,11 +74,11 @@ $: error__password = $auth0_token_error && $auth0_token_error.password //endregi
|
|
|
78
74
|
/>
|
|
79
75
|
<label
|
|
80
76
|
class="navigation__auth {label_class}"
|
|
81
|
-
on:click=
|
|
77
|
+
on:click={open_auth0_signup}
|
|
82
78
|
>Don't have an account? Signup…</label>
|
|
83
79
|
<label
|
|
84
80
|
class="navigation__auth {label_class}"
|
|
85
|
-
on:click=
|
|
81
|
+
on:click={open_auth0_forgot_password}
|
|
86
82
|
>Forgot Password?</label>
|
|
87
83
|
</footer>
|
|
88
84
|
</form>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AUTH0_DOMAIN$_b, auth0_token_error$_b, open_auth0_forgot_password_b, open_auth0_login_b,
|
|
4
|
+
} from '@ctx-core/auth0'
|
|
5
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
6
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
6
7
|
import { Auth0_c } from './Auth0_c.js'
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
export let class__button = ''
|
|
10
|
-
export let class__label = '.js'
|
|
8
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
9
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
11
10
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
12
11
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
13
12
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
@@ -15,13 +14,13 @@ const open_auth0_login = open_auth0_login_b(ctx)
|
|
|
15
14
|
const open_auth0_forgot_password = open_auth0_forgot_password_b(ctx)
|
|
16
15
|
const _ = new Auth0_c(ctx)
|
|
17
16
|
let root, signup_email_input, signup_password_input, signup_password_confirmation_input
|
|
18
|
-
let
|
|
19
|
-
$:
|
|
20
|
-
let
|
|
21
|
-
$:
|
|
22
|
-
let
|
|
23
|
-
$:
|
|
24
|
-
let error_text
|
|
17
|
+
let error_username:string|undefined //region
|
|
18
|
+
$: error_username = $auth0_token_error$?.username //endregion
|
|
19
|
+
let error_password:string|undefined //region
|
|
20
|
+
$: error_password = $auth0_token_error$?.password //endregion
|
|
21
|
+
let error_password_confirmation:string|undefined //region
|
|
22
|
+
$: error_password_confirmation = $auth0_token_error$ && error_password_confirmation //endregion
|
|
23
|
+
let error_text:string
|
|
25
24
|
$: {
|
|
26
25
|
let error_text_a = []
|
|
27
26
|
if ($auth0_token_error$) {
|
|
@@ -40,55 +39,55 @@ $: {
|
|
|
40
39
|
action="https://{$AUTH0_DOMAIN$}/dbconnections/signup"
|
|
41
40
|
accept-charset="UTF-8"
|
|
42
41
|
method="post"
|
|
43
|
-
on:submit=
|
|
42
|
+
on:submit={event =>
|
|
44
43
|
_.onsubmit_signup(event, {
|
|
45
44
|
signup_email_input,
|
|
46
45
|
signup_password_input,
|
|
47
46
|
signup_password_confirmation_input
|
|
48
|
-
}, _.
|
|
49
|
-
}
|
|
47
|
+
}, _.schedule_forms_clear(root))
|
|
48
|
+
}
|
|
50
49
|
>
|
|
51
50
|
{#if $auth0_token_error$}
|
|
52
51
|
<ul>
|
|
53
|
-
<li class="error {
|
|
52
|
+
<li class="error {error_class}">
|
|
54
53
|
{error_text}
|
|
55
54
|
</li>
|
|
56
55
|
</ul>
|
|
57
56
|
{/if}
|
|
58
57
|
<fieldset>
|
|
59
58
|
<label class="field">
|
|
60
|
-
<div class=
|
|
59
|
+
<div class={label_class}>Email</div>
|
|
61
60
|
<input
|
|
62
|
-
bind:this=
|
|
61
|
+
bind:this={signup_email_input}
|
|
63
62
|
placeholder="your@email.com"
|
|
64
63
|
required="required"
|
|
65
64
|
autocomplete="email"
|
|
66
|
-
class="form-control {
|
|
67
|
-
class:invalid=
|
|
65
|
+
class="form-control {input_class}"
|
|
66
|
+
class:invalid={error_username}
|
|
68
67
|
type="email"
|
|
69
68
|
id="email-signup"
|
|
70
69
|
name="email"/>
|
|
71
70
|
</label>
|
|
72
71
|
<label class="field">
|
|
73
|
-
<div class=
|
|
72
|
+
<div class={label_class}>Password</div>
|
|
74
73
|
<input
|
|
75
|
-
bind:this=
|
|
74
|
+
bind:this={signup_password_input}
|
|
76
75
|
placeholder="**********"
|
|
77
76
|
required="required"
|
|
78
|
-
class=
|
|
79
|
-
class:invalid=
|
|
77
|
+
class={input_class}
|
|
78
|
+
class:invalid={error_password}
|
|
80
79
|
id="password-signup"
|
|
81
80
|
type="password"
|
|
82
81
|
name="password"/>
|
|
83
82
|
</label>
|
|
84
83
|
<label class="field">
|
|
85
|
-
<div class=
|
|
84
|
+
<div class={label_class}>Confirm Password</div>
|
|
86
85
|
<input
|
|
87
|
-
bind:this=
|
|
86
|
+
bind:this={signup_password_confirmation_input}
|
|
88
87
|
placeholder="**********"
|
|
89
88
|
required="required"
|
|
90
|
-
class=
|
|
91
|
-
class:invalid=
|
|
89
|
+
class={input_class}
|
|
90
|
+
class:invalid={error_password_confirmation}
|
|
92
91
|
type="password"
|
|
93
92
|
name="password_confirmation"
|
|
94
93
|
id="password_confirmation-signup"/>
|
|
@@ -106,15 +105,15 @@ $: {
|
|
|
106
105
|
<input
|
|
107
106
|
type="submit"
|
|
108
107
|
value="Sign up"
|
|
109
|
-
class="button {
|
|
108
|
+
class="button {button_class}"
|
|
110
109
|
/>
|
|
111
110
|
<label
|
|
112
|
-
class="navigation__auth {
|
|
113
|
-
on:click=
|
|
111
|
+
class="navigation__auth {label_class}"
|
|
112
|
+
on:click={open_auth0_login}
|
|
114
113
|
>Have an account? Log in…</label>
|
|
115
114
|
<label
|
|
116
|
-
class="navigation__auth {
|
|
117
|
-
on:click=
|
|
115
|
+
class="navigation__auth {label_class}"
|
|
116
|
+
on:click={open_auth0_forgot_password}
|
|
118
117
|
>Forgot Password?</label>
|
|
119
118
|
</footer>
|
|
120
119
|
</form>
|