adding loggedIn to auth
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<nav class="no-print flex-row">
|
||||
<RouterLink to="/"><h1>HOME</h1></RouterLink>
|
||||
<RouterLink to="/"><p>HOME</p></RouterLink>
|
||||
<!-- <RouterLink to="/cv"><h1>CV</h1></RouterLink> -->
|
||||
</nav>
|
||||
</template>
|
||||
@@ -9,4 +9,7 @@
|
||||
nav {
|
||||
height: 10vh;
|
||||
}
|
||||
h1 {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useAuthStore } from "@/stores/auth";
|
||||
const auth = useAuthStore();
|
||||
const username = ref("");
|
||||
const password = ref("");
|
||||
const loggedIn = computed(() => !!auth.user.username);
|
||||
|
||||
function handleLogin() {
|
||||
auth.createUser(username.value, password.value);
|
||||
@@ -13,7 +12,7 @@ function handleLogin() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="loggedIn">
|
||||
<div v-if="auth.loggedIn">
|
||||
<h1>Logged in</h1>
|
||||
<p>{{ auth.user.ID }}</p>
|
||||
<p>{{ auth.user.username }}</p>
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useAuthStore } from "@/stores/auth";
|
||||
const auth = useAuthStore();
|
||||
const username = ref("");
|
||||
const password = ref("");
|
||||
const loggedIn = computed(() => !!auth.user.username);
|
||||
|
||||
function handleLogin() {
|
||||
auth.logIn(username.value, password.value);
|
||||
@@ -17,7 +16,7 @@ function handleLogout() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="loggedIn">
|
||||
<div v-if="auth.loggedIn">
|
||||
<h1>Logged in</h1>
|
||||
<p>{{ auth.user.ID }}</p>
|
||||
<p>{{ auth.user.username }}</p>
|
||||
|
||||
Reference in New Issue
Block a user