Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/ui/loginModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ export default {
h('form.defaultForm.login', {
onsubmit: onLogin
}, [
formError && !isTotpError(formError) ? h('div.form-error', formError) : null,
formError && !isTotpError(formError) ? h('div.form-error', formError) : null,
formError === 'InvalidTotpToken' ? h('div.form-error', i18n('invalidAuthenticationCode')) : null,
h('div.field', [
h('input#username', {
type: isTotpError(formError) ? 'hidden' : 'text',
className: formError ? 'form-error' : '',
name: 'username',
'aria-label': 'Username',
placeholder: i18n('username'),
autocomplete: 'off',
autocomplete: 'username',
autocapitalize: 'off',
autocorrect: 'off',
spellcheck: false,
Expand All @@ -53,7 +55,10 @@ export default {
h('input#password', {
type: isTotpError(formError) ? 'hidden' : 'password',
className: formError ? 'form-error' : '',
name: 'password',
'aria-label': 'Password',
placeholder: i18n('password'),
autocomplete: 'current-password',
required: true
}),
]),
Expand All @@ -72,8 +77,10 @@ export default {
]),
] : null,
h('div.submit', [
h('button.defaultButton', {
disabled: loading
h('button.defaultButton[type=submit]', {
disabled: loading,
value: 'LOGIN',
'aria-label': 'Sign In',
}, i18n('signIn'))
])
]),
Expand Down
31 changes: 21 additions & 10 deletions src/ui/signupModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,30 @@ function renderForm() {
h('div.field', [
formError && formError.username ?
h('div.form-error', formError.username[0]) : null,
h('input#pseudo[type=text]', {
h('input#username[type=text]', {
className: formError && formError.username ? 'form-error' : '',
onfocus: scrollToTop,
oninput: debounce(oninput, 500),
name: 'username',
'aria-label': 'Username',
placeholder: i18n('username'),
autocomplete: 'off',
autocomplete: 'username',
autocapitalize: 'off',
autocorrect: 'off',
spellcheck: false,
required: true,
onfocus: scrollToTop,
oninput: debounce(oninput, 500),
required: true
}),
]),
h('div.field', [
formError && formError.email ?
h('div.form-error', formError.email[0]) : null,
h('input#email[type=email]', {
onfocus: scrollToTop,
className: formError && formError.email ? 'form-error' : '',
onfocus: scrollToTop,
name: 'email',
'aria-label': 'Email',
placeholder: i18n('email'),
autocomplete: 'email',
autocapitalize: 'off',
autocorrect: 'off',
spellcheck: false,
Expand All @@ -107,15 +112,21 @@ function renderForm() {
formError && formError.password ?
h('div.form-error', formError.password[0]) : null,
h('input#password[type=password]', {
onfocus: scrollToTop,
className: formError && formError.password ? 'form-error' : '',
onfocus: scrollToTop,
name: 'password',
'aria-label': 'Password',
placeholder: i18n('password'),
required: true
autocomplete: 'new-password',
required: true,
passwordrules: 'minlength: 20; required: lower; required: upper; required: digit; required: [-];'
})
]),
h('div.submit', [
h('button.defaultButton', {
disabled: loading
h('button.defaultButton[type=submit]', {
disabled: loading,
value: 'SIGNUP',
'aria-label': 'Sign Up',
}, i18n('signUp'))
])
])
Expand Down