Big formatting spree
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m50s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m50s
This commit is contained in:
@@ -12,29 +12,39 @@ const username = ref("");
|
||||
const password = ref("");
|
||||
|
||||
async function handleLogin() {
|
||||
await auth.logIn(username.value, password.value);
|
||||
if (auth.loggedIn && route.query.redirect) {
|
||||
router.push(route.query.redirect);
|
||||
}
|
||||
await auth.logIn(username.value, password.value);
|
||||
if (auth.loggedIn && route.query.redirect) {
|
||||
router.push(route.query.redirect);
|
||||
}
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
auth.logOut();
|
||||
auth.logOut();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="auth.loggedIn" class="flex flex-col">
|
||||
<h1>Logged in</h1>
|
||||
<p>{{ auth.user.id }}</p>
|
||||
<p>{{ auth.user.username }}</p>
|
||||
<p>{{ auth.user.admin }}</p>
|
||||
<Button @click="handleLogout">Log Out</Button>
|
||||
</div>
|
||||
<div v-else class="flex flex-col">
|
||||
<h1>Login</h1>
|
||||
<input type="text" v-model="username" placeholder="Username" @keyup.enter="handleLogin" />
|
||||
<input type="password" v-model="password" placeholder="Password" @keyup.enter="handleLogin" />
|
||||
<Button @click="handleLogin">Log In</Button>
|
||||
</div>
|
||||
<div v-if="auth.loggedIn" class="flex flex-col">
|
||||
<h1>Logged in</h1>
|
||||
<p>{{ auth.user.id }}</p>
|
||||
<p>{{ auth.user.username }}</p>
|
||||
<p>{{ auth.user.admin }}</p>
|
||||
<Button @click="handleLogout">Log Out</Button>
|
||||
</div>
|
||||
<div v-else class="flex flex-col">
|
||||
<h1>Login</h1>
|
||||
<input
|
||||
type="text"
|
||||
v-model="username"
|
||||
placeholder="Username"
|
||||
@keyup.enter="handleLogin"
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
v-model="password"
|
||||
placeholder="Password"
|
||||
@keyup.enter="handleLogin"
|
||||
/>
|
||||
<Button @click="handleLogin">Log In</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user