@things-factory/auth-ui 8.0.0-beta.1 → 8.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/client/auth-style-sign.ts +0 -194
- package/client/bootstrap.ts +0 -51
- package/client/components/abstract-auth-page.ts +0 -301
- package/client/components/abstract-password-reset.ts +0 -163
- package/client/components/abstract-sign.ts +0 -127
- package/client/components/change-password.ts +0 -153
- package/client/components/contact-us.ts +0 -116
- package/client/components/create-domain-popup.ts +0 -141
- package/client/components/create-role.ts +0 -123
- package/client/components/create-user.ts +0 -117
- package/client/components/credential-manager.ts +0 -64
- package/client/components/delete-user-popup.ts +0 -117
- package/client/components/domain-switch.ts +0 -127
- package/client/components/invite-customer.ts +0 -104
- package/client/components/invite-user.ts +0 -104
- package/client/components/my-login-history.ts +0 -101
- package/client/components/ownership-transfer-popup.ts +0 -110
- package/client/components/partner-info-card.ts +0 -89
- package/client/components/partner-role-editor.ts +0 -153
- package/client/components/profile-component.ts +0 -392
- package/client/components/role-edit-form.ts +0 -92
- package/client/components/role-privilege-editor.ts +0 -268
- package/client/components/role-selector.ts +0 -102
- package/client/components/user-role-editor.ts +0 -499
- package/client/constants/application.ts +0 -9
- package/client/constants/index.ts +0 -1
- package/client/entries/auth/activate.ts +0 -272
- package/client/entries/auth/checkin.ts +0 -190
- package/client/entries/auth/forgot-password.ts +0 -112
- package/client/entries/auth/reset-password.ts +0 -22
- package/client/entries/auth/result.ts +0 -193
- package/client/entries/auth/signin.ts +0 -18
- package/client/entries/auth/signup.ts +0 -115
- package/client/entries/auth/unlock-user.ts +0 -22
- package/client/entries/oauth2/oauth2-decision-error-page.ts +0 -50
- package/client/entries/oauth2/oauth2-decision-page.ts +0 -196
- package/client/entries/public/home.ts +0 -246
- package/client/index.ts +0 -124
- package/client/pages/app-binding/app-binding.ts +0 -423
- package/client/pages/app-binding/app-bindings.ts +0 -171
- package/client/pages/appliance/appliance.ts +0 -452
- package/client/pages/appliance/home.ts +0 -177
- package/client/pages/appliance/register.ts +0 -183
- package/client/pages/application/application.ts +0 -428
- package/client/pages/application/applications.ts +0 -182
- package/client/pages/application/register.ts +0 -211
- package/client/pages/attribute/attribute-set-item-list.ts +0 -237
- package/client/pages/attribute/attribute-set-management.ts +0 -282
- package/client/pages/auth-provider/auth-provider-management.ts +0 -381
- package/client/pages/domain/domain-management.ts +0 -410
- package/client/pages/partner/partner-management.ts +0 -112
- package/client/pages/profile.ts +0 -32
- package/client/pages/role/role-management.ts +0 -134
- package/client/pages/user/user-management.ts +0 -223
- package/client/route.ts +0 -67
- package/client/themes/auth-theme.css +0 -65
- package/client/utils/password-rule.ts +0 -37
- package/server/index.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/auth-ui",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.4",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@operato/moment-timezone-es": "^8.0.0-beta",
|
|
37
37
|
"@operato/p13n": "^8.0.0-beta",
|
|
38
38
|
"@operato/popup": "^8.0.0-beta",
|
|
39
|
-
"@things-factory/auth-base": "^8.0.0-beta.
|
|
40
|
-
"@things-factory/more-base": "^8.0.0-beta.
|
|
39
|
+
"@things-factory/auth-base": "^8.0.0-beta.4",
|
|
40
|
+
"@things-factory/more-base": "^8.0.0-beta.4",
|
|
41
41
|
"base64url": "^3.0.1",
|
|
42
42
|
"clipboard": "^2.0.6"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d83d12ed4ba07177dff1dac26e37be347d156b43"
|
|
45
45
|
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit'
|
|
2
|
-
|
|
3
|
-
export const AUTH_STYLE_SIGN = css`
|
|
4
|
-
:host {
|
|
5
|
-
display: flex;
|
|
6
|
-
background-color: var(--md-sys-color-primary);
|
|
7
|
-
color: var(--md-sys-color-on-primary);
|
|
8
|
-
|
|
9
|
-
--md-filled-text-field-supporting-text-color: var(--md-sys-color-on-primary);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
:host *:focus {
|
|
13
|
-
outline: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host * {
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.wrap {
|
|
21
|
-
display: block;
|
|
22
|
-
width: 450px;
|
|
23
|
-
min-width: 350px;
|
|
24
|
-
margin: 0 auto;
|
|
25
|
-
padding-bottom: 100px;
|
|
26
|
-
text-align: center;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.auth-brand {
|
|
30
|
-
color: var(--md-sys-color-on-primary);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.auth-brand img {
|
|
34
|
-
margin: 15% auto 5px auto;
|
|
35
|
-
width: 100px;
|
|
36
|
-
border: 3px solid var(--md-sys-color-on-primary);
|
|
37
|
-
border-radius: 25px;
|
|
38
|
-
box-shadow: var(--box-shadow);
|
|
39
|
-
}
|
|
40
|
-
.name {
|
|
41
|
-
display: block;
|
|
42
|
-
font: var(--auth-brand-name);
|
|
43
|
-
text-shadow: var(--auth-brand-name-shadow);
|
|
44
|
-
}
|
|
45
|
-
.auth-brand .welcome-msg {
|
|
46
|
-
font: var(--auth-brand-welcome-msg);
|
|
47
|
-
}
|
|
48
|
-
.auth-form {
|
|
49
|
-
display: grid;
|
|
50
|
-
grid-gap: var(--spacing-medium);
|
|
51
|
-
grid-template-columns: 1fr 1fr;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
form {
|
|
55
|
-
grid-column: 1 / -1;
|
|
56
|
-
display: grid;
|
|
57
|
-
grid-template-columns: 1fr 1fr;
|
|
58
|
-
grid-gap: var(--spacing-medium);
|
|
59
|
-
align-items: center;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
h3 {
|
|
63
|
-
grid-column: 1 / -1;
|
|
64
|
-
margin: 50px 0 0 0;
|
|
65
|
-
font: var(--auth-title-font);
|
|
66
|
-
color: var(--auth-title-color, var(--md-sys-color-on-primary));
|
|
67
|
-
text-transform: uppercase;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.field {
|
|
71
|
-
grid-column: 1 / -1;
|
|
72
|
-
text-align: left;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.submit-buttons-container {
|
|
76
|
-
grid-column: 1 / -1;
|
|
77
|
-
text-align: center;
|
|
78
|
-
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
gap: 10px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.fingerprint {
|
|
85
|
-
color: var(--md-sys-color-on-primary);
|
|
86
|
-
border: 1.5px solid var(--md-sys-color-on-primary);
|
|
87
|
-
border-radius: 20%;
|
|
88
|
-
width: 36px;
|
|
89
|
-
height: 36px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.field md-filled-text-field {
|
|
93
|
-
grid-column: 1 / -1;
|
|
94
|
-
width: 100%;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
md-text-button,
|
|
98
|
-
md-elevated-button {
|
|
99
|
-
grid-column: 1 / -1;
|
|
100
|
-
flex: 1;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.wrap .link {
|
|
104
|
-
text-decoration: none;
|
|
105
|
-
justify-self: flex-start;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.wrap .link md-text-button {
|
|
109
|
-
--md-text-button-label-text-color: var(--md-sys-color-on-primary);
|
|
110
|
-
--md-text-button-focus-label-text-color: var(--md-sys-color-on-primary);
|
|
111
|
-
--md-text-button-hover-label-text-color: var(--md-sys-color-on-primary);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.wrap .link md-icon {
|
|
115
|
-
color: var(--md-sys-color-on-primary);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
#locale-area {
|
|
119
|
-
display: flex;
|
|
120
|
-
grid-column: 1 / -1;
|
|
121
|
-
padding: 0 var(--spacing-medium);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
#locale-area > label {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
color: var(--md-sys-color-on-primary);
|
|
128
|
-
--md-icon-size: 16px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
#locale-selector {
|
|
132
|
-
font-size: 16px;
|
|
133
|
-
width: 100%;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
#locale-selector {
|
|
137
|
-
--i18n-selector-field-border: none;
|
|
138
|
-
--i18n-selector-field-background-color: none;
|
|
139
|
-
--i18n-selector-field-font-size: 14px;
|
|
140
|
-
--i18n-selector-field-color: var(--md-sys-color-on-primary);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.lottie-container {
|
|
144
|
-
width: 100%;
|
|
145
|
-
height: 300px;
|
|
146
|
-
position: absolute;
|
|
147
|
-
left: 0;
|
|
148
|
-
bottom: 0;
|
|
149
|
-
pointer-events: none;
|
|
150
|
-
}
|
|
151
|
-
.lottie-container lottie-player {
|
|
152
|
-
position: absolute;
|
|
153
|
-
bottom: -6%;
|
|
154
|
-
width: 100%;
|
|
155
|
-
height: auto;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@media (max-width: 450px) {
|
|
159
|
-
.wrap {
|
|
160
|
-
width: 85%;
|
|
161
|
-
min-width: 320px;
|
|
162
|
-
}
|
|
163
|
-
.auth-form {
|
|
164
|
-
grid-template-columns: 1fr;
|
|
165
|
-
}
|
|
166
|
-
.auth-brand img {
|
|
167
|
-
margin: 12% auto 5px auto;
|
|
168
|
-
width: 75px;
|
|
169
|
-
}
|
|
170
|
-
h3 {
|
|
171
|
-
margin: 15px 0 0 0;
|
|
172
|
-
}
|
|
173
|
-
.lottie-container {
|
|
174
|
-
overflow: hidden;
|
|
175
|
-
height: 200px;
|
|
176
|
-
pointer-events: none;
|
|
177
|
-
}
|
|
178
|
-
.lottie-container lottie-player {
|
|
179
|
-
width: 1200px;
|
|
180
|
-
left: -30%;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
@media screen and (min-width: 1400px) {
|
|
185
|
-
.wrap {
|
|
186
|
-
padding-bottom: 150px;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
@media screen and (min-width: 2500px) {
|
|
190
|
-
.wrap {
|
|
191
|
-
padding-bottom: 280px;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
`
|
package/client/bootstrap.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/i18n/ox-i18n.js'
|
|
3
|
-
import '@operato/attribute/grist-editor' /* for register data-grist editor type 'attributes' */
|
|
4
|
-
|
|
5
|
-
import { html } from 'lit-html'
|
|
6
|
-
|
|
7
|
-
import { navigate, store } from '@operato/shell'
|
|
8
|
-
import { TOOL_POSITION } from '@operato/layout'
|
|
9
|
-
import { OxGristEditorPrivilege } from '@operato/app/grist-editor/ox-grist-editor-privilege.js'
|
|
10
|
-
import { registerEditor as registerGristEditor, registerRenderer as registerGristRenderer, OxGristRendererJson5 } from '@operato/data-grist'
|
|
11
|
-
|
|
12
|
-
import { auth } from '@things-factory/auth-base/dist-client/auth.js'
|
|
13
|
-
import { ADD_MORENDA } from '@things-factory/more-base/client'
|
|
14
|
-
|
|
15
|
-
export default function bootstrap() {
|
|
16
|
-
registerGristEditor('privilege', OxGristEditorPrivilege)
|
|
17
|
-
registerGristRenderer('privilege', OxGristRendererJson5)
|
|
18
|
-
|
|
19
|
-
/* add user profile morenda */
|
|
20
|
-
store.dispatch({
|
|
21
|
-
type: ADD_MORENDA,
|
|
22
|
-
morenda: {
|
|
23
|
-
icon: html` <md-icon>account_circle</md-icon> `,
|
|
24
|
-
name: html` <ox-i18n msgid="text.auth profile"></ox-i18n> `,
|
|
25
|
-
position: TOOL_POSITION.FRONT_END,
|
|
26
|
-
action: () => {
|
|
27
|
-
navigate('profile')
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
/* add sign-out morenda */
|
|
33
|
-
store.dispatch({
|
|
34
|
-
type: ADD_MORENDA,
|
|
35
|
-
morenda: {
|
|
36
|
-
icon: html` <md-icon>exit_to_app</md-icon> `,
|
|
37
|
-
name: html` <ox-i18n msgid="field.sign out"></ox-i18n> `,
|
|
38
|
-
position: TOOL_POSITION.FRONT_END,
|
|
39
|
-
action: () => {
|
|
40
|
-
auth.signout()
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
/*
|
|
46
|
-
Get user profile information from server.
|
|
47
|
-
As soon as response received, auth.on('profile', ...) handlers start to work.
|
|
48
|
-
It's very important point to build UI for the user.
|
|
49
|
-
*/
|
|
50
|
-
auth.profile()
|
|
51
|
-
}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@material/web/button/elevated-button.js'
|
|
3
|
-
import '@material/web/button/text-button.js'
|
|
4
|
-
import '@material/web/textfield/filled-text-field.js'
|
|
5
|
-
|
|
6
|
-
import '@operato/lottie-player'
|
|
7
|
-
import '@operato/i18n/ox-i18n.js'
|
|
8
|
-
import '@operato/i18n/ox-i18n-selector.js'
|
|
9
|
-
import '@operato/layout/ox-snack-bar.js'
|
|
10
|
-
|
|
11
|
-
import { css, html, LitElement, nothing } from 'lit'
|
|
12
|
-
import { property, query, state } from 'lit/decorators.js'
|
|
13
|
-
|
|
14
|
-
import { i18next, localize } from '@operato/i18n'
|
|
15
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
16
|
-
import { isSafari } from '@operato/utils'
|
|
17
|
-
|
|
18
|
-
import { AUTH_STYLE_SIGN } from '../auth-style-sign.js'
|
|
19
|
-
|
|
20
|
-
export abstract class AbstractAuthPage extends localize(i18next)(LitElement) {
|
|
21
|
-
static styles = [
|
|
22
|
-
ScrollbarStyles,
|
|
23
|
-
css`
|
|
24
|
-
:host {
|
|
25
|
-
position: relative;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: row;
|
|
30
|
-
|
|
31
|
-
width: 100vw;
|
|
32
|
-
height: 100vh;
|
|
33
|
-
height: 100dvh;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.content {
|
|
37
|
-
flex: 1;
|
|
38
|
-
overflow: auto;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.home {
|
|
42
|
-
position: absolute;
|
|
43
|
-
padding: var(--padding-dufault, 9px);
|
|
44
|
-
left: 20px;
|
|
45
|
-
top: 10px;
|
|
46
|
-
color: var(--md-sys-color-on-primary);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
div.field {
|
|
50
|
-
margin-bottom: var(--spacing-medium);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
[hidden] {
|
|
54
|
-
display: none;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
#snackbar {
|
|
58
|
-
width: 100%;
|
|
59
|
-
z-index: 10;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@media print {
|
|
63
|
-
:host {
|
|
64
|
-
width: 100%;
|
|
65
|
-
height: 100%;
|
|
66
|
-
min-height: 100vh;
|
|
67
|
-
min-height: 100dvh;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
`,
|
|
71
|
-
AUTH_STYLE_SIGN
|
|
72
|
-
]
|
|
73
|
-
|
|
74
|
-
@property({ type: Object }) data: any
|
|
75
|
-
@property({ type: String }) message?: string
|
|
76
|
-
@property({ type: Object }) detail: any
|
|
77
|
-
@property({ type: String }) redirectTo?: string
|
|
78
|
-
|
|
79
|
-
@query('#form') formEl!: HTMLFormElement
|
|
80
|
-
|
|
81
|
-
private _applicationMeta?: {
|
|
82
|
-
icon: string
|
|
83
|
-
title: string
|
|
84
|
-
description: string
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
get autocompletable() {
|
|
88
|
-
return false
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
render() {
|
|
92
|
-
const { disableUserFavoredLanguage, languages } = this.data || {}
|
|
93
|
-
var { icon, title, description } = this.applicationMeta
|
|
94
|
-
|
|
95
|
-
return html`
|
|
96
|
-
<div class="content md-typescale-display-medium">
|
|
97
|
-
<div class="wrap">
|
|
98
|
-
<div class="auth-brand">
|
|
99
|
-
<img src=${icon} />
|
|
100
|
-
<strong class="name">${title}</strong>
|
|
101
|
-
<span class="welcome-msg">${description}</span>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div class="auth-form">
|
|
105
|
-
<h3><ox-i18n msgid="title.${this.pageName}"></ox-i18n></h3>
|
|
106
|
-
|
|
107
|
-
<form
|
|
108
|
-
id="form"
|
|
109
|
-
action="${this.actionUrl}"
|
|
110
|
-
method="post"
|
|
111
|
-
autocomplete=${this.autocompletable ? 'on' : 'off'}
|
|
112
|
-
@keypress=${e => {
|
|
113
|
-
if (e.key == 'Enter') this._onSubmit(e)
|
|
114
|
-
}}
|
|
115
|
-
>
|
|
116
|
-
${this.formfields}
|
|
117
|
-
</form>
|
|
118
|
-
${this.links}
|
|
119
|
-
${!disableUserFavoredLanguage
|
|
120
|
-
? html` <div id="locale-area">
|
|
121
|
-
<label for="locale-selector"><md-icon>language</md-icon></label>
|
|
122
|
-
<ox-i18n-selector
|
|
123
|
-
id="locale-selector"
|
|
124
|
-
value=${i18next.language || 'en-US'}
|
|
125
|
-
.languages=${languages}
|
|
126
|
-
@change=${e => {
|
|
127
|
-
var locale = e.detail
|
|
128
|
-
if (!locale) return
|
|
129
|
-
|
|
130
|
-
i18next.changeLanguage(locale)
|
|
131
|
-
}}
|
|
132
|
-
></ox-i18n-selector>
|
|
133
|
-
</div>`
|
|
134
|
-
: nothing}
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<md-icon-button class="home" @click=${e => (window.location.href = '/')}
|
|
139
|
-
><md-icon>home</md-icon></md-icon-button
|
|
140
|
-
>
|
|
141
|
-
<ox-snack-bar id="snackbar" level="error" .message=${this.message}></ox-snack-bar>
|
|
142
|
-
|
|
143
|
-
${isSafari()
|
|
144
|
-
? html``
|
|
145
|
-
: html`
|
|
146
|
-
<div class="lottie-container">
|
|
147
|
-
<lottie-player autoplay loop src="../../assets/images/background-animation.json"></lottie-player>
|
|
148
|
-
</div>
|
|
149
|
-
`}
|
|
150
|
-
</div>
|
|
151
|
-
`
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
firstUpdated() {
|
|
155
|
-
setTimeout(() => {
|
|
156
|
-
;(this.renderRoot.querySelector('md-filled-text-field') as any).focus()
|
|
157
|
-
}, 100)
|
|
158
|
-
|
|
159
|
-
this.formEl.reset = () => {
|
|
160
|
-
this.formElements.filter(el => !(el.hidden || el.type == 'hidden')).forEach(el => (el.value = ''))
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
updated(changed) {
|
|
165
|
-
if (changed.has('data') && this.data) {
|
|
166
|
-
this.message = this.data.message
|
|
167
|
-
this.redirectTo = this.data.redirectTo
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
abstract get pageName(): string
|
|
172
|
-
abstract get actionUrl(): string
|
|
173
|
-
|
|
174
|
-
get formElements(): HTMLInputElement[] {
|
|
175
|
-
return Array.from(this.formEl.querySelectorAll('[name]'))
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
get formfields() {
|
|
179
|
-
const username = this.data?.username || ''
|
|
180
|
-
// .validationMessage=${String(i18next.t('text.invalid-username'))}
|
|
181
|
-
|
|
182
|
-
return html`
|
|
183
|
-
<input id="redirectTo" type="hidden" name="redirectTo" .value=${this.redirectTo || '/'} />
|
|
184
|
-
|
|
185
|
-
<div class="field">
|
|
186
|
-
<md-filled-text-field
|
|
187
|
-
name="username"
|
|
188
|
-
type="text"
|
|
189
|
-
label=${String(i18next.t('field.user-id or email'))}
|
|
190
|
-
required
|
|
191
|
-
.value=${username}
|
|
192
|
-
autocomplete="off"
|
|
193
|
-
autocapitalize="off"
|
|
194
|
-
><md-icon slot="leading-icon">id_card</md-icon></md-filled-text-field
|
|
195
|
-
>
|
|
196
|
-
</div>
|
|
197
|
-
<div class="field">
|
|
198
|
-
<md-filled-text-field
|
|
199
|
-
name="password"
|
|
200
|
-
type="password"
|
|
201
|
-
label=${String(i18next.t('field.password'))}
|
|
202
|
-
autocomplete="off"
|
|
203
|
-
required
|
|
204
|
-
><md-icon slot="leading-icon">password</md-icon></md-filled-text-field
|
|
205
|
-
>
|
|
206
|
-
</div>
|
|
207
|
-
|
|
208
|
-
<md-elevated-button class="ui" type="button" raised @click=${e => this._onSubmit(e)}>
|
|
209
|
-
<ox-i18n msgid="field.${this.pageName}"> </ox-i18n>
|
|
210
|
-
</md-elevated-button>
|
|
211
|
-
`
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
get links() {
|
|
215
|
-
const { disableUserSignupProcess, ssoLinks = [] } = this.data || {}
|
|
216
|
-
|
|
217
|
-
return html`
|
|
218
|
-
${!disableUserSignupProcess
|
|
219
|
-
? html`
|
|
220
|
-
<a class="link" href="/auth/signup">
|
|
221
|
-
<md-text-button>
|
|
222
|
-
<md-icon slot="icon">add_task</md-icon>
|
|
223
|
-
<ox-i18n msgid="field.sign up"></ox-i18n>
|
|
224
|
-
</md-text-button>
|
|
225
|
-
</a>
|
|
226
|
-
<a class="link" href="/auth/forgot-password">
|
|
227
|
-
<md-text-button>
|
|
228
|
-
<md-icon slot="icon">lock_open</md-icon>
|
|
229
|
-
<ox-i18n msgid="field.forgot-password"></ox-i18n>
|
|
230
|
-
</md-text-button>
|
|
231
|
-
</a>
|
|
232
|
-
`
|
|
233
|
-
: nothing}
|
|
234
|
-
${ssoLinks.map(
|
|
235
|
-
sso => html`
|
|
236
|
-
<a class="link" href=${sso.link}>
|
|
237
|
-
<md-text-button>
|
|
238
|
-
<md-icon slot="icon">id_card</md-icon>
|
|
239
|
-
${i18next.t('label.signin with', { title: sso.title })}
|
|
240
|
-
</md-text-button>
|
|
241
|
-
</a>
|
|
242
|
-
`
|
|
243
|
-
)}
|
|
244
|
-
`
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
async _onSubmit(e) {
|
|
248
|
-
if (this.checkValidity()) {
|
|
249
|
-
this.submit()
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
checkValidity() {
|
|
254
|
-
return this.formElements.every(el => el.checkValidity())
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
abstract submit()
|
|
258
|
-
|
|
259
|
-
showSnackbar({ level, message, timer = 3000 }: { level?: string; message?: string; timer?: number } = {}) {
|
|
260
|
-
const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {
|
|
261
|
-
level: string
|
|
262
|
-
message: string
|
|
263
|
-
active: boolean
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (level) snackbar.level = level
|
|
267
|
-
if (message) snackbar.message = message
|
|
268
|
-
snackbar.active = true
|
|
269
|
-
|
|
270
|
-
if (timer > -1)
|
|
271
|
-
setTimeout(() => {
|
|
272
|
-
this.hideSnackbar()
|
|
273
|
-
}, timer)
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
hideSnackbar() {
|
|
277
|
-
const snackbar = this.renderRoot.querySelector('#snackbar') as HTMLElement & {
|
|
278
|
-
level: string
|
|
279
|
-
message: string
|
|
280
|
-
active: boolean
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
snackbar.active = false
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
get applicationMeta() {
|
|
287
|
-
if (!this._applicationMeta) {
|
|
288
|
-
var iconLink: HTMLLinkElement | null = document.querySelector('link[rel="application-icon"]')
|
|
289
|
-
var titleMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-name"]')
|
|
290
|
-
var descriptionMeta: HTMLMetaElement | null = document.querySelector('meta[name="application-description"]')
|
|
291
|
-
|
|
292
|
-
this._applicationMeta = {
|
|
293
|
-
icon: iconLink?.href || '',
|
|
294
|
-
title: titleMeta?.content || 'Things Factory',
|
|
295
|
-
description: descriptionMeta?.content || 'Reimagining Software'
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return this._applicationMeta
|
|
300
|
-
}
|
|
301
|
-
}
|