mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: 👽 Support Versia Server 0.9 login system
Some checks failed
Some checks failed
This commit is contained in:
parent
cc95f043bd
commit
dc32f3b3ea
21 changed files with 221 additions and 567 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue