mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-05-14 19:25:37 +08:00
Restrict cookie banner when authenticated
This commit is contained in:
16
app/app.vue
16
app/app.vue
@@ -1,8 +1,22 @@
|
||||
<template>
|
||||
<v-app>
|
||||
<NuxtPage/>
|
||||
<CookieConsentBanner/>
|
||||
<CookieConsentBanner v-if="showCookieBanner"/>
|
||||
</v-app>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from '#imports';
|
||||
import { useAuthStore } from '~/stores/auth';
|
||||
|
||||
const route = useRoute();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const showCookieBanner = computed(() => {
|
||||
if (!authStore.isAuthenticated) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return route.path === '/';
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user