@things-factory/auth-ui 8.0.38 → 9.0.0-9.0.0-beta.59.0

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 (142) hide show
  1. package/dist-client/components/abstract-auth-page.d.ts +1 -1
  2. package/dist-client/components/abstract-auth-page.js +2 -0
  3. package/dist-client/components/abstract-auth-page.js.map +1 -1
  4. package/dist-client/components/abstract-password-reset.d.ts +2 -2
  5. package/dist-client/components/abstract-password-reset.js +5 -5
  6. package/dist-client/components/abstract-password-reset.js.map +1 -1
  7. package/dist-client/components/change-password.js +1 -1
  8. package/dist-client/components/change-password.js.map +1 -1
  9. package/dist-client/components/invite-user.d.ts +1 -1
  10. package/dist-client/components/invite-user.js +1 -2
  11. package/dist-client/components/invite-user.js.map +1 -1
  12. package/dist-client/components/partner-role-editor.js +1 -1
  13. package/dist-client/components/partner-role-editor.js.map +1 -1
  14. package/dist-client/components/profile-component.d.ts +3 -3
  15. package/dist-client/components/profile-component.js +3 -3
  16. package/dist-client/components/profile-component.js.map +1 -1
  17. package/dist-client/components/role-privilege-editor.js +2 -1
  18. package/dist-client/components/role-privilege-editor.js.map +1 -1
  19. package/dist-client/components/user-role-editor.d.ts +2 -2
  20. package/dist-client/components/user-role-editor.js +2 -2
  21. package/dist-client/components/user-role-editor.js.map +1 -1
  22. package/dist-client/constants/index.d.ts +1 -1
  23. package/dist-client/constants/index.js +1 -1
  24. package/dist-client/constants/index.js.map +1 -1
  25. package/dist-client/entries/auth/activate.d.ts +1 -1
  26. package/dist-client/entries/auth/activate.js +1 -1
  27. package/dist-client/entries/auth/activate.js.map +1 -1
  28. package/dist-client/entries/auth/checkin.js +2 -2
  29. package/dist-client/entries/auth/checkin.js.map +1 -1
  30. package/dist-client/entries/auth/forgot-password.d.ts +2 -2
  31. package/dist-client/entries/auth/forgot-password.js +11 -3
  32. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  33. package/dist-client/entries/auth/reset-password.d.ts +1 -1
  34. package/dist-client/entries/auth/reset-password.js +1 -1
  35. package/dist-client/entries/auth/reset-password.js.map +1 -1
  36. package/dist-client/entries/auth/result.d.ts +1 -1
  37. package/dist-client/entries/auth/result.js +1 -1
  38. package/dist-client/entries/auth/result.js.map +1 -1
  39. package/dist-client/entries/auth/signin.d.ts +1 -1
  40. package/dist-client/entries/auth/signin.js +1 -1
  41. package/dist-client/entries/auth/signin.js.map +1 -1
  42. package/dist-client/entries/auth/signup.d.ts +3 -1
  43. package/dist-client/entries/auth/signup.js +32 -2
  44. package/dist-client/entries/auth/signup.js.map +1 -1
  45. package/dist-client/entries/auth/unlock-user.d.ts +1 -1
  46. package/dist-client/entries/auth/unlock-user.js +1 -1
  47. package/dist-client/entries/auth/unlock-user.js.map +1 -1
  48. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  49. package/dist-client/entries/oauth2/oauth2-decision-page.js +1 -1
  50. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  51. package/dist-client/entries/public/home.js +2 -2
  52. package/dist-client/entries/public/home.js.map +1 -1
  53. package/dist-client/pages/application/application.js +1 -1
  54. package/dist-client/pages/application/application.js.map +1 -1
  55. package/dist-client/pages/domain/domain-management.d.ts +1 -1
  56. package/dist-client/pages/domain/domain-management.js +1 -1
  57. package/dist-client/pages/domain/domain-management.js.map +1 -1
  58. package/dist-client/pages/domain-link/domain-link-management.d.ts +53 -0
  59. package/dist-client/pages/domain-link/domain-link-management.js +353 -0
  60. package/dist-client/pages/domain-link/domain-link-management.js.map +1 -0
  61. package/dist-client/pages/partner/partner-management.d.ts +3 -3
  62. package/dist-client/pages/partner/partner-management.js +3 -3
  63. package/dist-client/pages/partner/partner-management.js.map +1 -1
  64. package/dist-client/pages/profile.d.ts +1 -1
  65. package/dist-client/pages/profile.js +1 -1
  66. package/dist-client/pages/profile.js.map +1 -1
  67. package/dist-client/pages/role/role-management.d.ts +3 -3
  68. package/dist-client/pages/role/role-management.js +3 -3
  69. package/dist-client/pages/role/role-management.js.map +1 -1
  70. package/dist-client/pages/user/user-management.d.ts +4 -4
  71. package/dist-client/pages/user/user-management.js +4 -4
  72. package/dist-client/pages/user/user-management.js.map +1 -1
  73. package/dist-client/route.js +3 -0
  74. package/dist-client/route.js.map +1 -1
  75. package/dist-client/tsconfig.tsbuildinfo +1 -1
  76. package/dist-server/tsconfig.tsbuildinfo +1 -1
  77. package/helps/auth/domain-link.md +178 -0
  78. package/package.json +12 -12
  79. package/things-factory.config.js +2 -1
  80. package/translations/en.json +7 -0
  81. package/translations/ja.json +7 -0
  82. package/translations/ko.json +7 -0
  83. package/translations/ms.json +7 -0
  84. package/translations/zh.json +7 -0
  85. package/client/auth-style-sign.ts +0 -194
  86. package/client/bootstrap.ts +0 -55
  87. package/client/components/abstract-auth-page.ts +0 -301
  88. package/client/components/abstract-password-reset.ts +0 -163
  89. package/client/components/abstract-sign.ts +0 -127
  90. package/client/components/change-password.ts +0 -153
  91. package/client/components/contact-us.ts +0 -116
  92. package/client/components/create-domain-popup.ts +0 -141
  93. package/client/components/create-role.ts +0 -123
  94. package/client/components/create-user.ts +0 -117
  95. package/client/components/credential-manager.ts +0 -64
  96. package/client/components/delete-user-popup.ts +0 -117
  97. package/client/components/domain-switch.ts +0 -127
  98. package/client/components/invite-customer.ts +0 -104
  99. package/client/components/invite-user.ts +0 -104
  100. package/client/components/my-login-history.ts +0 -101
  101. package/client/components/ownership-transfer-popup.ts +0 -110
  102. package/client/components/partner-info-card.ts +0 -89
  103. package/client/components/partner-role-editor.ts +0 -153
  104. package/client/components/profile-component.ts +0 -392
  105. package/client/components/role-edit-form.ts +0 -92
  106. package/client/components/role-privilege-editor.ts +0 -267
  107. package/client/components/role-selector.ts +0 -102
  108. package/client/components/user-role-editor.ts +0 -499
  109. package/client/constants/application.ts +0 -9
  110. package/client/constants/index.ts +0 -1
  111. package/client/entries/auth/activate.ts +0 -272
  112. package/client/entries/auth/checkin.ts +0 -183
  113. package/client/entries/auth/forgot-password.ts +0 -104
  114. package/client/entries/auth/reset-password.ts +0 -22
  115. package/client/entries/auth/result.ts +0 -193
  116. package/client/entries/auth/signin.ts +0 -18
  117. package/client/entries/auth/signup.ts +0 -115
  118. package/client/entries/auth/unlock-user.ts +0 -22
  119. package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
  120. package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
  121. package/client/entries/public/home.ts +0 -246
  122. package/client/index.ts +0 -124
  123. package/client/pages/app-binding/app-binding.ts +0 -423
  124. package/client/pages/app-binding/app-bindings.ts +0 -171
  125. package/client/pages/appliance/appliance.ts +0 -452
  126. package/client/pages/appliance/home.ts +0 -177
  127. package/client/pages/appliance/register.ts +0 -183
  128. package/client/pages/application/application.ts +0 -428
  129. package/client/pages/application/applications.ts +0 -182
  130. package/client/pages/application/register.ts +0 -211
  131. package/client/pages/attribute/attribute-set-item-list.ts +0 -237
  132. package/client/pages/attribute/attribute-set-management.ts +0 -282
  133. package/client/pages/auth-provider/auth-provider-management.ts +0 -381
  134. package/client/pages/domain/domain-management.ts +0 -431
  135. package/client/pages/partner/partner-management.ts +0 -112
  136. package/client/pages/profile.ts +0 -32
  137. package/client/pages/role/role-management.ts +0 -134
  138. package/client/pages/user/user-management.ts +0 -223
  139. package/client/route.ts +0 -67
  140. package/client/themes/auth-theme.css +0 -65
  141. package/client/utils/password-rule.ts +0 -37
  142. package/server/index.ts +0 -0
@@ -1,272 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@material/web/button/elevated-button.js'
3
-
4
- import '@operato/i18n/ox-i18n.js'
5
- import '@operato/layout/ox-snack-bar.js'
6
- import '@operato/lottie-player'
7
- import '../../components/contact-us'
8
-
9
- import { css, html, LitElement } from 'lit'
10
- import { customElement, property, query } from 'lit/decorators.js'
11
-
12
- import { i18next, localize } from '@operato/i18n'
13
-
14
- @customElement('auth-activate')
15
- export class AuthActivate extends localize(i18next)(LitElement) {
16
- static styles = [
17
- css`
18
- :host {
19
- display: flex;
20
- width: 100vw;
21
- height: 100vh;
22
- height: 100dvh;
23
- background-color: var(--md-sys-color-primary);
24
- color: var(--md-sys-color-on-primary);
25
- }
26
-
27
- .wrap {
28
- display: block;
29
- width: 450px;
30
- min-width: 350px;
31
- margin: 0 auto;
32
- text-align: center;
33
- }
34
-
35
- .auth-brand {
36
- color: #fff;
37
- }
38
-
39
- .auth-brand img {
40
- margin: 15% auto 5px auto;
41
- width: 100px;
42
- border: 3px solid var(--md-sys-color-on-primary);
43
- border-radius: 25px;
44
- box-shadow: var(--box-shadow);
45
- }
46
-
47
- .name {
48
- display: block;
49
- font: var(--auth-brand-name);
50
- text-shadow: var(--auth-brand-name-shadow);
51
- }
52
-
53
- h1 {
54
- margin: 50px 0 0 0;
55
- padding: 0;
56
- font-size: 24px;
57
- color: var(--auth-title-color, var(--md-sys-color-on-primary));
58
- }
59
-
60
- p {
61
- margin: 0;
62
- padding: var(--auth-description-padding);
63
- font: var(--auth-description-font);
64
- color: var(--auth-description-color, var(--md-sys-color-on-secondary));
65
- }
66
-
67
- #button-area {
68
- border-top: 1px dashed #ccc;
69
- padding-top: 10px;
70
- }
71
-
72
- md-elevated-button {
73
- --md-elevated-button-horizontal-padding: var(--spacing-medium);
74
- --md-elevated-button-ink-color: var(--md-sys-color-primary);
75
- }
76
-
77
- contact-us {
78
- display: flex;
79
- padding: 50px;
80
- flex-direction: column;
81
- }
82
-
83
- .lottie-container {
84
- width: 100%;
85
- height: 300px;
86
- position: absolute;
87
- left: 0;
88
- bottom: 0;
89
- pointer-events: none;
90
- }
91
-
92
- .lottie-container lottie-player {
93
- position: absolute;
94
- bottom: -6%;
95
- width: 100%;
96
- height: auto;
97
- }
98
-
99
- @media (max-width: 450px) {
100
- .wrap {
101
- width: 85%;
102
- min-width: 320px;
103
- padding-bottom: 100px;
104
- }
105
-
106
- .auth-form {
107
- grid-template-columns: 1fr;
108
- }
109
-
110
- .auth-brand img {
111
- margin: 12% auto 5px auto;
112
- width: 75px;
113
- }
114
-
115
- .lottie-container {
116
- overflow: hidden;
117
- height: 200px;
118
- pointer-events: none;
119
- }
120
-
121
- .lottie-container lottie-player {
122
- width: 1200px;
123
- left: -30%;
124
- }
125
- }
126
- `
127
- ]
128
-
129
- @property({ type: Object }) data: any
130
- @property({ type: String }) email?: string | null
131
-
132
- @query('#form') form!: HTMLFormElement
133
-
134
- private _applicationMeta?: { icon?: string; title?: string; description?: string }
135
-
136
- render() {
137
- var { icon, title, description } = this.applicationMeta
138
-
139
- return html`
140
- <div class="wrap">
141
- <div class="auth-brand">
142
- <img src=${icon} />
143
- <strong class="name">${title}</strong>
144
- <span class="welcome-msg">${description}</span>
145
- </div>
146
-
147
- <h1><ox-i18n msgid="text.your account is not activated"></ox-i18n></h1>
148
-
149
- <!--description message container-->
150
- <p></p>
151
-
152
- <form
153
- id="form"
154
- action="/auth/resend-verification-email"
155
- method="POST"
156
- @submit=${e => {
157
- this.requestResend(e)
158
- }}
159
- hidden
160
- >
161
- <input name="email" type="hidden" .value=${this.email || ''} required />
162
- <button id="submit-button" type="submit"><ox-i18n msgid="label.change password"></ox-i18n></button>
163
- </form>
164
-
165
- <div id="button-area">
166
- <md-elevated-button @click=${e => this.requestResend(e)}>
167
- <md-icon slot="icon">mail_outline</md-icon>
168
- ${i18next.t('label.send activation email')}
169
- </md-elevated-button>
170
- <md-elevated-button
171
- @click=${e => {
172
- window.location.replace('/auth/signin')
173
- }}
174
- >
175
- <md-icon slot="icon">home</md-icon>
176
- ${i18next.t('button.go to home')}
177
- </md-elevated-button>
178
- </div>
179
- <contact-us></contact-us>
180
-
181
- <!--lottie animation begin-->
182
- <div class="lottie-container">
183
- <lottie-player autoplay loop src="../../assets/images/background-animation.json"></lottie-player>
184
- </div>
185
- <!--lottie animation end-->
186
- </div>
187
-
188
- <ox-snack-bar id="snackbar"></ox-snack-bar>
189
- `
190
- }
191
-
192
- get applicationMeta() {
193
- if (!this._applicationMeta) {
194
- var iconLink: HTMLLinkElement | null = document.querySelector('link[rel="application-icon"]')
195
- var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-name"]')
196
- var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-description"]')
197
-
198
- this._applicationMeta = {
199
- icon: iconLink?.href,
200
- title: titleMeta ? titleMeta.content : 'Things Factory',
201
- description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'
202
- }
203
- }
204
-
205
- return this._applicationMeta
206
- }
207
-
208
- firstUpdated() {
209
- var searchParams = new URLSearchParams(window.location.search)
210
- this.email = searchParams.get('email')
211
- }
212
-
213
- updated(changed) {
214
- if (changed.has('data')) {
215
- this.email = this.data?.email
216
- }
217
- }
218
-
219
- async requestResend(e) {
220
- var timer
221
- var formData = new FormData(this.form)
222
- var button = e.target
223
- try {
224
- var controller = new AbortController()
225
- var signal = controller.signal
226
-
227
- button.disabled = true
228
- timer = setTimeout(() => {
229
- controller.abort()
230
- throw new Error('timeout')
231
- }, 30 * 1000)
232
-
233
- var response = await fetch('/auth/resend-verification-email', {
234
- credentials: 'include',
235
- method: 'POST',
236
- headers: {
237
- 'Content-Type': 'application/json'
238
- },
239
- body: JSON.stringify(Object.fromEntries(formData.entries())),
240
- signal
241
- })
242
-
243
- if (response) {
244
- this.showSnackbar({
245
- level: response.ok ? 'info' : 'error',
246
- message: await response.text()
247
- })
248
- }
249
- } catch (e) {
250
- } finally {
251
- button.disabled = false
252
- clearTimeout(timer)
253
- }
254
- }
255
-
256
- showSnackbar({ level, message, timer = 3000 }: { level: 'info' | 'error'; message: string; timer?: number }) {
257
- const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {
258
- level: 'info' | 'error'
259
- message: string
260
- active: boolean
261
- }
262
-
263
- snackbar.level = level
264
- snackbar.message = message
265
- snackbar.active = true
266
-
267
- if (timer > -1)
268
- setTimeout(() => {
269
- snackbar.active = false
270
- }, timer)
271
- }
272
- }
@@ -1,183 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@material/web/button/elevated-button.js'
3
-
4
- import '@operato/lottie-player'
5
-
6
- import { css, html, LitElement } from 'lit'
7
- import { customElement, property } from 'lit/decorators.js'
8
-
9
- import { i18next, localize } from '@operato/i18n'
10
- import { ScrollbarStyles } from '@operato/styles'
11
- import { isSafari } from '@operato/utils'
12
-
13
- import { AUTH_STYLE_SIGN } from '../../auth-style-sign'
14
-
15
- @customElement('auth-checkin')
16
- export class AuthCheckIn extends localize(i18next)(LitElement) {
17
- static styles = [
18
- ScrollbarStyles,
19
- css`
20
- :host {
21
- display: flex;
22
- flex-direction: column;
23
- margin: auto;
24
- background-color: var(--md-sys-color-primary);
25
- color: var(--md-sys-color-on-primary);
26
- height: 100vh;
27
- height: 100dvh;
28
- }
29
-
30
- .header {
31
- background-color: var(--md-sys-color-primary);
32
- color: var(--md-sys-color-on-primary);
33
- height: var(--checkin-header-height);
34
- }
35
-
36
- .content {
37
- flex: 1;
38
- overflow: auto;
39
- }
40
-
41
- .domains {
42
- margin: var(--spacing-large) 0;
43
- padding: 0;
44
- background-color: var(--md-sys-color-surface);
45
- color: var(--md-sys-color-on-surface);
46
- border-radius: var(--border-radius);
47
- border: var(--border-dim-color);
48
- list-style: none;
49
- }
50
-
51
- li {
52
- border-bottom: var(--border-dim-color);
53
- padding: var(--spacing-medium) var(--spacing-large);
54
- font-size: 18px;
55
- text-align: left;
56
-
57
- cursor: pointer;
58
- }
59
-
60
- li:hover {
61
- background-color: var(--md-sys-color-primary-container);
62
- color: var(--md-sys-color-on-primary-container);
63
- }
64
-
65
- li span {
66
- display: block;
67
- font: normal var(--fontsize-default) var(--theme-font);
68
- }
69
-
70
- li md-icon {
71
- float: right;
72
- margin: 10px 0 0 0;
73
- opacity: 0.5;
74
- }
75
-
76
- .button-container {
77
- text-align: center;
78
- }
79
-
80
- .button-container md-elevated-button {
81
- margin-left: var(--spacing-small);
82
- }
83
-
84
- @media (max-width: 450px) {
85
- .button-container md-elevated-button {
86
- width: 100%;
87
- margin: var(--spacing-medium) 0 0 0;
88
- }
89
- }
90
- `,
91
- AUTH_STYLE_SIGN
92
- ]
93
-
94
- @property({ type: Object }) data: any
95
- @property({ type: Array }) domains: any[] = []
96
- @property({ type: Array }) domainTypes?: string[]
97
- @property({ type: Object }) user: any
98
-
99
- private _applicationMeta?: { icon?: string; title?: string; description?: string }
100
- private redirectTo?: string
101
-
102
- render() {
103
- var { icon, title, description } = this.applicationMeta
104
-
105
- return html`
106
- <div class="content md-typescale-display-medium">
107
- <div class="wrap">
108
- <div class="auth-brand">
109
- <img src=${icon || ''} />
110
- <strong class="name">${title}</strong>
111
- <span class="welcome-msg">${description}</span>
112
- </div>
113
-
114
- <h3>${i18next.t('label.select_domain')}</h3>
115
-
116
- ${this.domains?.length
117
- ? html`
118
- <ul class="domains">
119
- ${this.domains.map(
120
- domain => html`
121
- <li
122
- @click=${() =>
123
- (location.href = `/auth/checkin/${domain.subdomain}?redirect_to=${encodeURIComponent(this.redirectTo || '/')}`)}
124
- >
125
- <md-icon>keyboard_arrow_right</md-icon>
126
- <strong>${domain.name}</strong>
127
- <span>${domain.description}&nbsp;</span>
128
- </li>
129
- `
130
- )}
131
- </ul>
132
- `
133
- : html` <h3>${i18next.t('text.no domain available')}</h3> `}
134
-
135
- <div class="button-container">
136
- <md-elevated-button @click=${() => (location.pathname = '/auth/signout')}
137
- >${String(i18next.t('button.logout'))}</md-elevated-button
138
- >
139
- </div>
140
-
141
- ${isSafari()
142
- ? html``
143
- : html`
144
- <div class="lottie-container">
145
- <lottie-player autoplay loop src="../../assets/images/background-animation.json"></lottie-player>
146
- </div>
147
- `}
148
- </div>
149
- </div>
150
- `
151
- }
152
-
153
- updated(changed) {
154
- if (changed.has('data')) {
155
- this.domains = this.data.domains
156
- this.user = this.data.user
157
- this.domainTypes = this.data.domainTypes
158
- this.redirectTo = this.data.redirectTo
159
-
160
- this.requestUpdate()
161
- }
162
- }
163
-
164
- navigateToUrl(url) {
165
- location.pathname = url
166
- }
167
-
168
- get applicationMeta() {
169
- if (!this._applicationMeta) {
170
- var iconLink: HTMLLinkElement | null = document.querySelector('link[rel="application-icon"]')
171
- var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-name"]')
172
- var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-description"]')
173
-
174
- this._applicationMeta = {
175
- icon: iconLink?.href,
176
- title: titleMeta ? titleMeta.content : 'Things Factory',
177
- description: descriptionMeta ? descriptionMeta.content : 'Reimagining Software'
178
- }
179
- }
180
-
181
- return this._applicationMeta
182
- }
183
- }
@@ -1,104 +0,0 @@
1
- import '@material/web/button/elevated-button.js'
2
- import '@material/web/button/text-button.js'
3
-
4
- import '@operato/i18n/ox-i18n.js'
5
- import '../../components/profile-component'
6
-
7
- import { html } from 'lit'
8
- import { customElement, query } from 'lit/decorators.js'
9
-
10
- import { i18next } from '@operato/i18n'
11
-
12
- import { AbstractAuthPage } from '../../components/abstract-auth-page'
13
-
14
- @customElement('forgot-password')
15
- export class ForgotPassword extends AbstractAuthPage {
16
- @query('#email') emailInput!: HTMLInputElement
17
- @query('#submit-button') button!: HTMLInputElement
18
-
19
- get pageName() {
20
- return 'forgot password'
21
- }
22
-
23
- get actionUrl() {
24
- return '/auth/forgot-password'
25
- }
26
-
27
- get formfields() {
28
- const email = this.data?.email || ''
29
-
30
- return html`
31
- <div class="field">
32
- <md-filled-text-field
33
- name="email"
34
- type="email"
35
- label=${String(i18next.t('label.email'))}
36
- .value=${email}
37
- required
38
- @input=${(e: Event) => {
39
- const target = e.target as HTMLInputElement
40
- if (target.validity.typeMismatch) {
41
- target.setCustomValidity(i18next.t('text.invalid-email'))
42
- } else {
43
- target.setCustomValidity('')
44
- }
45
- }}
46
- ><md-icon slot="leading-icon">mail</md-icon></md-filled-text-field
47
- >
48
- </div>
49
- <md-elevated-button id="submit-button" class="ui button" type="submit" @click=${e => this._onSubmit(e)}>
50
- <ox-i18n msgid="button.submit"></ox-i18n>
51
- </md-elevated-button>
52
- `
53
- }
54
-
55
- get links() {
56
- return html`
57
- <a class="link" href="/auth/signin">
58
- <md-text-button><ox-i18n msgid="field.sign in"></ox-i18n></md-text-button>
59
- </a>
60
- `
61
- }
62
-
63
- async submit() {
64
- var timer
65
- var formData = new FormData(this.formEl)
66
-
67
- try {
68
- var controller = new AbortController()
69
- var signal = controller.signal
70
-
71
- this.button.disabled = true
72
- timer = setTimeout(() => {
73
- controller.abort()
74
- throw new Error('timeout')
75
- }, 30 * 1000)
76
-
77
- var response = await fetch('/auth/forgot-password', {
78
- credentials: 'include',
79
- method: 'POST',
80
- headers: {
81
- 'Content-Type': 'application/json'
82
- },
83
- body: JSON.stringify(Object.fromEntries(formData.entries())),
84
- signal
85
- })
86
-
87
- this.showSnackbar({
88
- message: await response.text(),
89
- level: response.ok ? 'info' : 'error'
90
- })
91
- } catch (e) {
92
- } finally {
93
- this.button.disabled = false
94
- clearTimeout(timer)
95
- }
96
- }
97
-
98
- showSnackbar({ message, level }) {
99
- super.showSnackbar({
100
- level,
101
- message
102
- })
103
- }
104
- }
@@ -1,22 +0,0 @@
1
- import { customElement } from 'lit/decorators.js'
2
-
3
- import { AbstractPasswordReset } from '../../components/abstract-password-reset'
4
-
5
- @customElement('reset-password')
6
- export class ResetPassword extends AbstractPasswordReset {
7
- get pageName() {
8
- return 'reset password'
9
- }
10
-
11
- get actionUrl() {
12
- return '/auth/reset-password'
13
- }
14
-
15
- get submitButtonLabel() {
16
- return 'label.change password'
17
- }
18
-
19
- get title() {
20
- return 'reset password'
21
- }
22
- }