nidus-sync/ts/view/Home.vue
Eli Ribble efa01cffc2
Move session management into session store
Trying to get rid of the redirect to signin on any page refresh
2026-04-17 14:52:02 +00:00

23 lines
555 B
Vue

<template>
<p>loading home...</p>
</template>
<script setup lang="ts">
import { onMounted } from "vue";
import { useSessionStore } from "@/store/session";
import { Session } from "@/type/api";
import { router } from "@/router";
const session = useSessionStore();
onMounted(() => {
session
.get()
.then((session: Session) => {
console.log("hit home with a valid session, going to dash");
router.push("/_/dash");
})
.catch((e) => {
console.log("hit home with no session, going to signin");
router.push("/signin");
});
});
</script>