fix: harden login for MLPS requirements
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
v-model="formState.identifier"
|
||||
type="text"
|
||||
placeholder="账户"
|
||||
autocomplete="off"
|
||||
autocomplete="username"
|
||||
required
|
||||
@focus="isTyping = true"
|
||||
@blur="isTyping = false"
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="options">
|
||||
<label class="remember">
|
||||
<input v-model="remember" type="checkbox" />
|
||||
{{ t('auth.rememberPassword') }}
|
||||
{{ t('auth.rememberAccount') }}
|
||||
</label>
|
||||
<a href="#" class="forgot">{{ t('auth.forgotPassword') }}</a>
|
||||
</div>
|
||||
@@ -127,9 +127,8 @@ onMounted(() => {
|
||||
return
|
||||
}
|
||||
const parsed = JSON.parse(raw) as { identifier?: string; password?: string }
|
||||
if (parsed && typeof parsed.identifier === 'string' && typeof parsed.password === 'string') {
|
||||
if (parsed && typeof parsed.identifier === 'string') {
|
||||
formState.identifier = parsed.identifier
|
||||
formState.password = parsed.password
|
||||
remember.value = true
|
||||
}
|
||||
} catch {
|
||||
@@ -144,7 +143,7 @@ function persistRememberedCredentials(): void {
|
||||
if (remember.value) {
|
||||
window.localStorage.setItem(
|
||||
REMEMBER_STORAGE_KEY,
|
||||
JSON.stringify({ identifier: formState.identifier, password: formState.password }),
|
||||
JSON.stringify({ identifier: formState.identifier }),
|
||||
)
|
||||
} else {
|
||||
window.localStorage.removeItem(REMEMBER_STORAGE_KEY)
|
||||
|
||||
Reference in New Issue
Block a user