feat: 👽 Support Versia Server 0.9 login system
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 0s
Deploy to GitHub Pages / build (push) Failing after 0s
Deploy to GitHub Pages / deploy (push) Has been skipped
Docker / build (push) Failing after 0s
Mirror to Codeberg / Mirror (push) Failing after 0s

This commit is contained in:
Jesse Wierzbinski 2025-11-21 12:16:00 +01:00
parent cc95f043bd
commit dc32f3b3ea
No known key found for this signature in database
21 changed files with 221 additions and 567 deletions

View file

@ -1,10 +1,7 @@
<template>
<SidebarProvider>
<AppSidebar>
<slot v-if="!route.meta.requiresAuth || authStore.isSignedIn" />
<div class="mx-auto max-w-4xl p-4" v-else>
<AuthRequired />
</div>
<slot />
</AppSidebar>
</SidebarProvider>
<MobileNavbar v-if="authStore.isSignedIn" />
@ -14,7 +11,6 @@
<script setup lang="ts">
import ComposerDialog from "~/components/composer/dialog.vue";
import AuthRequired from "~/components/errors/AuthRequired.vue";
import MobileNavbar from "~/components/navigation/mobile-navbar.vue";
import Preferences from "~/components/preferences/index.vue";
import AppSidebar from "~/components/sidebars/sidebar.vue";
@ -32,6 +28,17 @@ const notUsingInput = computed(
);
const route = useRoute();
watch(
() => route.path,
async () => {
console.log(route.meta.requiresAuth && !authStore.isSignedIn);
if (route.meta.requiresAuth && !authStore.isSignedIn) {
window.location.href = "/";
}
},
{ immediate: true },
);
watch([n, notUsingInput, d], async () => {
if (n?.value && notUsingInput.value) {
// Wait 50ms