Login page now redirects if logged in
This commit is contained in:
parent
6643d432e7
commit
dba021fc30
@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
|
||||
const user = ref('')
|
||||
const pass = ref('')
|
||||
@ -34,6 +34,14 @@ async function login(ev) {
|
||||
pass.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
let resp = await fetch("/api/user")
|
||||
console.log(resp)
|
||||
if (resp.ok) {
|
||||
window.location.hash = "/"
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user