@things-factory/auth-ui 10.1.183 → 10.1.192

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 (31) hide show
  1. package/dist-client/components/abstract-auth-page.d.ts +0 -6
  2. package/dist-client/components/abstract-auth-page.js +16 -17
  3. package/dist-client/components/abstract-auth-page.js.map +1 -1
  4. package/dist-client/components/abstract-password-reset.js +1 -11
  5. package/dist-client/components/abstract-password-reset.js.map +1 -1
  6. package/dist-client/components/abstract-sign.d.ts +0 -1
  7. package/dist-client/components/abstract-sign.js +0 -14
  8. package/dist-client/components/abstract-sign.js.map +1 -1
  9. package/dist-client/components/accept-invitation.d.ts +0 -1
  10. package/dist-client/components/accept-invitation.js +1 -12
  11. package/dist-client/components/accept-invitation.js.map +1 -1
  12. package/dist-client/components/toasts-go-through-notify.test.d.ts +1 -0
  13. package/dist-client/components/toasts-go-through-notify.test.js +48 -0
  14. package/dist-client/components/toasts-go-through-notify.test.js.map +1 -0
  15. package/dist-client/entries/auth/activate-page.test.d.ts +1 -0
  16. package/dist-client/entries/auth/activate-page.test.js +26 -0
  17. package/dist-client/entries/auth/activate-page.test.js.map +1 -0
  18. package/dist-client/entries/auth/activate.d.ts +0 -5
  19. package/dist-client/entries/auth/activate.js +23 -24
  20. package/dist-client/entries/auth/activate.js.map +1 -1
  21. package/dist-client/entries/auth/forgot-password.d.ts +0 -4
  22. package/dist-client/entries/auth/forgot-password.js +5 -9
  23. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  24. package/dist-client/tsconfig.tsbuildinfo +1 -1
  25. package/package.json +5 -5
  26. package/translations/en.json +2 -0
  27. package/translations/es.json +2 -0
  28. package/translations/ja.json +2 -0
  29. package/translations/ko.json +2 -0
  30. package/translations/ms.json +2 -0
  31. package/translations/zh.json +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"activate.js","sourceRoot":"","sources":["../../../client/entries/auth/activate.ts"],"names":[],"mappings":";AAAA,OAAO,4B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AQ,CAAC,MAAM,GAAG,IAAI,CAAA;QAEtB,IAAI,KAAK,GAAG,CAAC,CAAC;YACZ,UAAU,CAAC,GAAG,EAAE;gBACd,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAA;YACzB,CAAC,EAAE,KAAK,CAAC,CAAA;IACb,CAAC;;AA7I2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAsB;AAEjC;IAAf,KAAK,CAAC,OAAO,CAAC;8BAAQ,eAAe;0CAAA;AAhH3B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA2PxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/layout/ox-snack-bar.js'\nimport '@operato/lottie-player'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { EntryControlSizeStyles } from '../../entry-control-size-styles.js'\n\n@customElement('auth-activate')\nexport class AuthActivate extends localize(i18next)(LitElement) {\n static styles = [\n EntryControlSizeStyles,\n css`\n :host {\n display: flex;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .wrap {\n display: block;\n width: 450px;\n min-width: 350px;\n margin: 0 auto;\n text-align: center;\n }\n\n .auth-brand {\n color: #fff;\n }\n\n .auth-brand img {\n margin: 15% auto 5px auto;\n width: 100px;\n border: 3px solid var(--md-sys-color-on-primary);\n border-radius: 25px;\n box-shadow: var(--box-shadow);\n }\n\n .name {\n display: block;\n font: var(--auth-brand-name);\n text-shadow: var(--auth-brand-name-shadow);\n }\n\n h1 {\n margin: 50px 0 0 0;\n padding: 0;\n font-size: 24px;\n color: var(--auth-title-color, var(--md-sys-color-on-primary));\n }\n\n p {\n margin: 0;\n padding: var(--auth-description-padding);\n font: var(--auth-description-font);\n color: var(--auth-description-color, var(--md-sys-color-on-secondary));\n }\n\n #button-area {\n border-top: 1px dashed #ccc;\n padding-top: 10px;\n }\n\n md-elevated-button {\n --md-elevated-button-horizontal-padding: var(--spacing-medium);\n --md-elevated-button-ink-color: var(--md-sys-color-primary);\n }\n\n .lottie-container {\n width: 100%;\n height: 300px;\n position: absolute;\n left: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n position: absolute;\n bottom: -6%;\n width: 100%;\n height: auto;\n }\n\n @media (max-width: 450px) {\n .wrap {\n width: 85%;\n min-width: 320px;\n padding-bottom: 100px;\n }\n\n .auth-form {\n grid-template-columns: 1fr;\n }\n\n .auth-brand img {\n margin: 12% auto 5px auto;\n width: 75px;\n }\n\n .lottie-container {\n overflow: hidden;\n height: 200px;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n width: 1200px;\n left: -30%;\n }\n }\n `\n ]\n\n @property({ type: Object }) data: any\n @property({ type: String }) email?: string | null\n\n @query('#form') form!: HTMLFormElement\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n return html`\n <div class=\"wrap\">\n <div class=\"auth-brand\">\n <img src=${icon} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <h1><ox-i18n msgid=\"text.your account is not activated\"></ox-i18n></h1>\n\n <!--description message container-->\n <p></p>\n\n <form\n id=\"form\"\n action=\"/auth/resend-verification-email\"\n method=\"POST\"\n @submit=${e => {\n this.requestResend(e)\n }}\n hidden\n >\n <input name=\"email\" type=\"hidden\" .value=${this.email || ''} required />\n <button id=\"submit-button\" type=\"submit\"><ox-i18n msgid=\"label.change password\"></ox-i18n></button>\n </form>\n\n <div id=\"button-area\">\n <md-elevated-button @click=${e => this.requestResend(e)}>\n <md-icon slot=\"icon\">mail_outline</md-icon>\n ${i18next.t('label.send activation email')}\n </md-elevated-button>\n <md-elevated-button\n @click=${e => {\n window.location.replace('/auth/signin')\n }}\n >\n <md-icon slot=\"icon\">home</md-icon>\n ${i18next.t('button.go to home')}\n </md-elevated-button>\n </div>\n\n <!--lottie animation begin-->\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n <!--lottie animation end-->\n </div>\n\n <ox-snack-bar id=\"snackbar\"></ox-snack-bar>\n `\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink: HTMLLinkElement | null = document.querySelector('link[rel=\"application-icon\"]')\n var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-name\"]')\n var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-description\"]')\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta ? titleMeta.content : 'Things Factory',\n description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n\n firstUpdated() {\n var searchParams = new URLSearchParams(window.location.search)\n this.email = searchParams.get('email')\n }\n\n updated(changed) {\n if (changed.has('data')) {\n this.email = this.data?.email\n }\n }\n\n async requestResend(e) {\n var timer\n var formData = new FormData(this.form)\n var button = e.target\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/resend-verification-email', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n if (response) {\n this.showSnackbar({\n level: response.ok ? 'info' : 'error',\n message: await response.text()\n })\n }\n } catch (e) {\n } finally {\n button.disabled = false\n clearTimeout(timer)\n }\n }\n\n showSnackbar({ level, message, timer = 3000 }: { level: 'info' | 'error'; message: string; timer?: number }) {\n const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {\n level: 'info' | 'error'\n message: string\n active: boolean\n }\n\n snackbar.level = level\n snackbar.message = message\n snackbar.active = true\n\n if (timer > -1)\n setTimeout(() => {\n snackbar.active = false\n }, timer)\n }\n}\n"]}
1
+ {"version":3,"file":"activate.js","sourceRoot":"","sources":["../../../client/entries/auth/activate.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,0BAA0B,CAAA;AACjC,OAAO,iCAAiC,CAAA;AACxC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAGpE,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;aACtD,WAAM,GAAG;QACd,sBAAsB;QACtB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuGF;KACF,AA1GY,CA0GZ;IASD,MAAM;QACJ,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAEvD;;;;WAIG;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,KAAK,aAAa,CAAA;QAErD,OAAO,IAAI,CAAA;;;qBAGM,IAAI;iCACQ,KAAK;sCACA,WAAW;;;cAGnC,OA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,MAAM;aACP,CAAC,CAAA;YAEF,MAAM,CAAC;gBACL,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;gBACxC,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;aAC/B,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;QAChF,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;YACvB,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;;AArI2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAsB;AAEjC;IAAf,KAAK,CAAC,OAAO,CAAC;8BAAQ,eAAe;0CAAA;AAhH3B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAmPxB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/layout/ox-snack-bar.js'\nimport '@operato/lottie-player'\n\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { EntryControlSizeStyles } from '../../entry-control-size-styles.js'\n\n@customElement('auth-activate')\nexport class AuthActivate extends localize(i18next)(LitElement) {\n static styles = [\n EntryControlSizeStyles,\n css`\n :host {\n display: flex;\n width: 100vw;\n height: 100vh;\n height: 100dvh;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n .wrap {\n display: block;\n width: 450px;\n min-width: 350px;\n margin: 0 auto;\n text-align: center;\n }\n\n .auth-brand {\n color: #fff;\n }\n\n .auth-brand img {\n margin: 15% auto 5px auto;\n width: 100px;\n border: 3px solid var(--md-sys-color-on-primary);\n border-radius: 25px;\n box-shadow: var(--box-shadow);\n }\n\n .name {\n display: block;\n font: var(--auth-brand-name);\n text-shadow: var(--auth-brand-name-shadow);\n }\n\n h1 {\n margin: 50px 0 0 0;\n padding: 0;\n font-size: 24px;\n color: var(--auth-title-color, var(--md-sys-color-on-primary));\n }\n\n p {\n margin: 0;\n padding: var(--auth-description-padding);\n font: var(--auth-description-font);\n color: var(--auth-description-color, var(--md-sys-color-on-secondary));\n }\n\n #button-area {\n border-top: 1px dashed #ccc;\n padding-top: 10px;\n }\n\n md-elevated-button {\n --md-elevated-button-horizontal-padding: var(--spacing-medium);\n --md-elevated-button-ink-color: var(--md-sys-color-primary);\n }\n\n .lottie-container {\n width: 100%;\n height: 300px;\n position: absolute;\n left: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n position: absolute;\n bottom: -6%;\n width: 100%;\n height: auto;\n }\n\n @media (max-width: 450px) {\n .wrap {\n width: 85%;\n min-width: 320px;\n padding-bottom: 100px;\n }\n\n .auth-form {\n grid-template-columns: 1fr;\n }\n\n .auth-brand img {\n margin: 12% auto 5px auto;\n width: 75px;\n }\n\n .lottie-container {\n overflow: hidden;\n height: 200px;\n pointer-events: none;\n }\n\n .lottie-container lottie-player {\n width: 1200px;\n left: -30%;\n }\n }\n `\n ]\n\n @property({ type: Object }) data: any\n @property({ type: String }) email?: string | null\n\n @query('#form') form!: HTMLFormElement\n\n private _applicationMeta?: { icon?: string; title?: string; description?: string }\n\n render() {\n var { icon, title, description } = this.applicationMeta\n\n /*\n * The server sends a locked account here as well as one not yet confirmed. Locked, it has\n * already mailed the unlock link - an activation mail on top would be a second, different way\n * back, so that button is for the unconfirmed only.\n */\n const locked = this.data?.errorCode === 'user-locked'\n\n return html`\n <div class=\"wrap\">\n <div class=\"auth-brand\">\n <img src=${icon} />\n <strong class=\"name\">${title}</strong>\n <span class=\"welcome-msg\">${description}</span>\n </div>\n\n <h1>${i18next.t(locked ? 'text.your account is locked' : 'text.your account is not activated')}</h1>\n\n ${locked ? html`<p>${i18next.t('text.unlock email sent')}</p>` : nothing}\n\n <form\n id=\"form\"\n action=\"/auth/resend-verification-email\"\n method=\"POST\"\n @submit=${e => {\n this.requestResend(e)\n }}\n hidden\n >\n <input name=\"email\" type=\"hidden\" .value=${this.email || ''} required />\n <button id=\"submit-button\" type=\"submit\"><ox-i18n msgid=\"label.change password\"></ox-i18n></button>\n </form>\n\n <div id=\"button-area\">\n ${locked\n ? nothing\n : html`\n <md-elevated-button @click=${e => this.requestResend(e)}>\n <md-icon slot=\"icon\">mail_outline</md-icon>\n ${i18next.t('label.send activation email')}\n </md-elevated-button>\n `}\n <md-elevated-button\n @click=${e => {\n window.location.replace('/auth/signin')\n }}\n >\n <md-icon slot=\"icon\">home</md-icon>\n ${i18next.t('button.go to home')}\n </md-elevated-button>\n </div>\n\n <!--lottie animation begin-->\n <div class=\"lottie-container\">\n <lottie-player autoplay loop src=\"../../assets/images/background-animation.json\"></lottie-player>\n </div>\n <!--lottie animation end-->\n </div>\n\n <ox-snack-bar id=\"snackbar\"></ox-snack-bar>\n `\n }\n\n get applicationMeta() {\n if (!this._applicationMeta) {\n var iconLink: HTMLLinkElement | null = document.querySelector('link[rel=\"application-icon\"]')\n var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-name\"]')\n var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name=\"application-description\"]')\n\n this._applicationMeta = {\n icon: iconLink?.href,\n title: titleMeta ? titleMeta.content : 'Things Factory',\n description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'\n }\n }\n\n return this._applicationMeta\n }\n\n firstUpdated() {\n var searchParams = new URLSearchParams(window.location.search)\n this.email = searchParams.get('email')\n }\n\n updated(changed) {\n if (changed.has('data')) {\n this.email = this.data?.email\n }\n }\n\n async requestResend(e) {\n var timer\n var formData = new FormData(this.form)\n var button = e.target\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/resend-verification-email', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n notify({\n level: response.ok ? 'success' : 'error',\n message: await response.text()\n })\n } catch (e) {\n notify({ level: 'error', message: i18next.t('text.please try again'), ex: e })\n } finally {\n button.disabled = false\n clearTimeout(timer)\n }\n }\n}\n"]}
@@ -11,8 +11,4 @@ export declare class ForgotPassword extends AbstractAuthPage {
11
11
  get formfields(): import("lit-html").TemplateResult<1>;
12
12
  get links(): import("lit-html").TemplateResult<1>;
13
13
  submit(): Promise<void>;
14
- showSnackbar({ message, level }: {
15
- message: any;
16
- level: any;
17
- }): void;
18
14
  }
@@ -6,6 +6,7 @@ import '../../components/profile-component.js';
6
6
  import { html } from 'lit';
7
7
  import { customElement, query } from 'lit/decorators.js';
8
8
  import { i18next } from '@operato/i18n';
9
+ import { notify } from '@operato/layout';
9
10
  import { AbstractAuthPage } from '../../components/abstract-auth-page.js';
10
11
  let ForgotPassword = class ForgotPassword extends AbstractAuthPage {
11
12
  get pageName() {
@@ -76,24 +77,19 @@ let ForgotPassword = class ForgotPassword extends AbstractAuthPage {
76
77
  body: JSON.stringify(Object.fromEntries(formData.entries())),
77
78
  signal
78
79
  });
79
- this.showSnackbar({
80
- message: await response.text(),
81
- level: response.ok ? 'info' : 'error'
80
+ notify({
81
+ level: response.ok ? 'success' : 'error',
82
+ message: await response.text()
82
83
  });
83
84
  }
84
85
  catch (e) {
86
+ notify({ level: 'error', message: i18next.t('text.please try again'), ex: e });
85
87
  }
86
88
  finally {
87
89
  this.button.disabled = false;
88
90
  clearTimeout(timer);
89
91
  }
90
92
  }
91
- showSnackbar({ message, level }) {
92
- super.showSnackbar({
93
- level,
94
- message
95
- });
96
- }
97
93
  };
98
94
  __decorate([
99
95
  query('#email'),
@@ -1 +1 @@
1
- {"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["../../../client/entries/auth/forgot-password.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,qCAAqC,CAAA;AAE5C,OAAO,0BAA0B,CAAA;AACjC,OAAO,uCAAuC,CAAA;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAGlE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAgB;IAIlD,IAAI,QAAQ;QACV,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,uBAAuB,CAAA;IAChC,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAA;QAEpC,OAAO,IAAI,CAAA;;;;;kBAKG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;mBAC/B,KAAK;;mBAEL,CAAC,CAAQ,EAAE,EAAE;YACpB,MAAM,MAAM,GAAG,CAAC,CAAC,MAA0B,CAAA;YAC3C,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;gBACjC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAA;YAC3D,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;YAC9B,CAAC;QACH,CAAC;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AI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;YAC5B,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;IAED,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE;QAC7B,KAAK,CAAC,YAAY,CAAC;YACjB,KAAK;YACL,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhGkB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAc,gBAAgB;kDAAA;AACrB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;8BAAU,gBAAgB;8CAAA;AAFvC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAiG1B","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@material/web/button/text-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '../../components/profile-component.js'\n\nimport { html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { AbstractAuthPage } from '../../components/abstract-auth-page.js'\n\n@customElement('forgot-password')\nexport class ForgotPassword extends AbstractAuthPage {\n @query('#email') emailInput!: HTMLInputElement\n @query('#submit-button') button!: HTMLInputElement\n\n get pageName() {\n return 'forgot password'\n }\n\n get actionUrl() {\n return '/auth/forgot-password'\n }\n\n get formfields() {\n const email = this.data?.email || ''\n\n return html`\n <div class=\"field\">\n <md-filled-text-field\n name=\"email\"\n type=\"email\"\n label=${String(i18next.t('label.email'))}\n .value=${email}\n required\n @input=${(e: Event) => {\n const target = e.target as HTMLInputElement\n if (target.validity.typeMismatch) {\n target.setCustomValidity(i18next.t('text.invalid-email'))\n } else {\n target.setCustomValidity('')\n }\n }}\n ><md-icon slot=\"leading-icon\">mail</md-icon></md-filled-text-field\n >\n </div>\n <md-elevated-button\n id=\"submit-button\"\n class=\"ui button\"\n type=\"button\"\n @click=${e => {\n this._onSubmit(e)\n return false\n }}\n >\n <ox-i18n msgid=\"button.submit\"></ox-i18n>\n </md-elevated-button>\n `\n }\n\n get links() {\n return html`\n <a class=\"link\" href=\"/auth/signin\">\n <md-text-button><ox-i18n msgid=\"field.sign in\"></ox-i18n></md-text-button>\n </a>\n `\n }\n\n async submit() {\n var timer\n var formData = new FormData(this.formEl)\n\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n this.button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/forgot-password', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n this.showSnackbar({\n message: await response.text(),\n level: response.ok ? 'info' : 'error'\n })\n } catch (e) {\n } finally {\n this.button.disabled = false\n clearTimeout(timer)\n }\n }\n\n showSnackbar({ message, level }) {\n super.showSnackbar({\n level,\n message\n })\n }\n}\n"]}
1
+ {"version":3,"file":"forgot-password.js","sourceRoot":"","sources":["../../../client/entries/auth/forgot-password.ts"],"names":[],"mappings":";AAAA,OAAO,yCAAyC,CAAA;AAChD,OAAO,qCAAqC,CAAA;AAE5C,OAAO,0BAA0B,CAAA;AACjC,OAAO,uCAAuC,CAAA;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA;AAGlE,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAgB;IAIlD,IAAI,QAAQ;QACV,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,uBAAuB,CAAA;IAChC,CAAC;IAED,IAAI,UAAU;QACZ,MAAM,KAAK,GAAG,IAAI,CA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BACtB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC5D,MAAM;aACP,CAAC,CAAA;YAEF,MAAM,CAAC;gBACL,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;gBACxC,OAAO,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;aAC/B,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;QAChF,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAA;YAC5B,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC;CACF,CAAA;AA1FkB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAc,gBAAgB;kDAAA;AACrB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;8BAAU,gBAAgB;8CAAA;AAFvC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CA2F1B","sourcesContent":["import '@material/web/button/elevated-button.js'\nimport '@material/web/button/text-button.js'\n\nimport '@operato/i18n/ox-i18n.js'\nimport '../../components/profile-component.js'\n\nimport { html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { notify } from '@operato/layout'\n\nimport { AbstractAuthPage } from '../../components/abstract-auth-page.js'\n\n@customElement('forgot-password')\nexport class ForgotPassword extends AbstractAuthPage {\n @query('#email') emailInput!: HTMLInputElement\n @query('#submit-button') button!: HTMLInputElement\n\n get pageName() {\n return 'forgot password'\n }\n\n get actionUrl() {\n return '/auth/forgot-password'\n }\n\n get formfields() {\n const email = this.data?.email || ''\n\n return html`\n <div class=\"field\">\n <md-filled-text-field\n name=\"email\"\n type=\"email\"\n label=${String(i18next.t('label.email'))}\n .value=${email}\n required\n @input=${(e: Event) => {\n const target = e.target as HTMLInputElement\n if (target.validity.typeMismatch) {\n target.setCustomValidity(i18next.t('text.invalid-email'))\n } else {\n target.setCustomValidity('')\n }\n }}\n ><md-icon slot=\"leading-icon\">mail</md-icon></md-filled-text-field\n >\n </div>\n <md-elevated-button\n id=\"submit-button\"\n class=\"ui button\"\n type=\"button\"\n @click=${e => {\n this._onSubmit(e)\n return false\n }}\n >\n <ox-i18n msgid=\"button.submit\"></ox-i18n>\n </md-elevated-button>\n `\n }\n\n get links() {\n return html`\n <a class=\"link\" href=\"/auth/signin\">\n <md-text-button><ox-i18n msgid=\"field.sign in\"></ox-i18n></md-text-button>\n </a>\n `\n }\n\n async submit() {\n var timer\n var formData = new FormData(this.formEl)\n\n try {\n var controller = new AbortController()\n var signal = controller.signal\n\n this.button.disabled = true\n timer = setTimeout(() => {\n controller.abort()\n throw new Error('timeout')\n }, 30 * 1000)\n\n var response = await fetch('/auth/forgot-password', {\n credentials: 'include',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(Object.fromEntries(formData.entries())),\n signal\n })\n\n notify({\n level: response.ok ? 'success' : 'error',\n message: await response.text()\n })\n } catch (e) {\n notify({ level: 'error', message: i18next.t('text.please try again'), ex: e })\n } finally {\n this.button.disabled = false\n clearTimeout(timer)\n }\n }\n}\n"]}