2026-03-21 20:58:44 +00:00
|
|
|
<template>
|
2026-04-16 17:14:57 +00:00
|
|
|
<p>loading home...</p>
|
2026-03-21 20:58:44 +00:00
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2026-04-16 17:14:57 +00:00
|
|
|
import { onMounted } from "vue";
|
2026-03-31 14:52:53 +00:00
|
|
|
import { useSessionStore } from "@/store/session";
|
2026-04-16 17:14:57 +00:00
|
|
|
import { Session } from "@/type/api";
|
2026-04-22 14:31:05 +00:00
|
|
|
import { router } from "@/route/config";
|
2026-03-31 14:52:53 +00:00
|
|
|
|
|
|
|
|
const session = useSessionStore();
|
2026-04-16 17:14:57 +00:00
|
|
|
onMounted(() => {
|
|
|
|
|
session
|
|
|
|
|
.get()
|
|
|
|
|
.then((session: Session) => {
|
2026-04-17 14:52:02 +00:00
|
|
|
console.log("hit home with a valid session, going to dash");
|
2026-04-16 17:14:57 +00:00
|
|
|
router.push("/_/dash");
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
2026-04-17 14:52:02 +00:00
|
|
|
console.log("hit home with no session, going to signin");
|
2026-04-16 17:30:54 +00:00
|
|
|
router.push("/signin");
|
2026-04-16 17:14:57 +00:00
|
|
|
});
|
2026-04-14 19:05:10 +00:00
|
|
|
});
|
2026-03-21 20:58:44 +00:00
|
|
|
</script>
|