removed obsolete remember me button, added notification when trying to go down a protected route
This commit is contained in:
@@ -1,23 +1,16 @@
|
||||
<template>
|
||||
<img src="/src/assets/logo.png">
|
||||
<form class="m-auto">
|
||||
<h1 class="h3 mb-3">Bitte einloggen</h1>
|
||||
<h1 class="h3 mb-4">Bitte einloggen</h1>
|
||||
<div class="form-floating">
|
||||
<input type="text" class="form-control" id="usernameInput" v-model="input.username" placeholder="Benutzername">
|
||||
<label for="usernameInput">Benutzername</label>
|
||||
</div>
|
||||
<div class="form-floating">
|
||||
<div class="form-floating mb-4">
|
||||
<input type="password" class="form-control" id="passwordInput" v-model="input.password" placeholder="Passwort">
|
||||
<label for="passwordInput">Passwort</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check my-3 mx-auto" style="width: 170px">
|
||||
<input class="form-check-input" v-model="input.rememberMe" type="checkbox" id="rememberMeCheckbox">
|
||||
<label for="rememberMeCheckbox" class="form-check-label">
|
||||
Eingeloggt bleiben
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-success w-100 mb-5" @click.prevent="onClick">Einloggen</button>
|
||||
</form>
|
||||
</template>
|
||||
@@ -34,12 +27,11 @@ const router = useRouter()
|
||||
const input = reactive({
|
||||
username: '',
|
||||
password: '',
|
||||
rememberMe: false
|
||||
})
|
||||
|
||||
async function onClick() {
|
||||
/**TODO #20 Use sessionStorage or localStorage based on rememberMe! */
|
||||
if(await userStore.login(input.username, input.password, input.rememberMe)) {
|
||||
if(await userStore.login(input.username, input.password)) {
|
||||
router.push({name: 'Home'})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user