Login page now redirects if logged in

This commit is contained in:
Lucas Schumacher 2023-10-30 17:33:38 -04:00
parent 6643d432e7
commit dba021fc30

View File

@ -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>