Move admin auth guard to Vue Router
Deploy with Docker Compose / deploy (push) Successful in 24s

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-04-13 11:09:12 +01:00
co-authored by Claude Sonnet 4.6
parent fc9d3c97bf
commit 869d9a168e
2 changed files with 19 additions and 20 deletions
+3 -20
View File
@@ -1,14 +1,8 @@
<script setup>
import { ref, watch } from "vue";
import { useRouter, RouterLink } from "vue-router";
import { useAuthStore } from "@/stores/auth";
import { useHomeDataStore } from "@/stores/homeData";
import { ref, onMounted } from "vue";
import { RouterLink } from "vue-router";
import { gql } from "@/graphql";
const auth = useAuthStore();
const homeData = useHomeDataStore();
const router = useRouter();
const applications = ref([]);
const editingId = ref(null);
const editForm = ref({});
@@ -150,18 +144,7 @@ function statusClass(status) {
return map[status] ?? "";
}
watch(
() => homeData.loaded,
(loaded) => {
if (!loaded) return;
if (!auth.user.admin) {
router.push("/admin");
} else {
fetchApplications();
}
},
{ immediate: true },
);
onMounted(fetchApplications);
</script>
<template>