mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 21:14:23 +00:00
Add a login wall on a few windows, but still no auth / login logic
yet...
This commit is contained in:
parent
020251c706
commit
a89fbd4fd7
9 changed files with 157 additions and 64 deletions
39
components/blurPageBeforeLogin.vue
Normal file
39
components/blurPageBeforeLogin.vue
Normal file
|
@ -0,0 +1,39 @@
|
|||
<script setup lang="ts">
|
||||
// Imports
|
||||
const { t } = useI18n();
|
||||
// Values
|
||||
const allowed = ref(false);
|
||||
const error = ref(false);
|
||||
const errorMsg = ref("");
|
||||
|
||||
onMounted(async () => {
|
||||
// Check Cookie
|
||||
try {
|
||||
const { data, error: sendError } = useFetch("/api/user/checkcookie");
|
||||
if (sendError) {
|
||||
error.value = true;
|
||||
}
|
||||
if (false) {
|
||||
allowed.value = true;
|
||||
} else {
|
||||
allowed.value = false;
|
||||
}
|
||||
} catch (e) {
|
||||
error.value = true;
|
||||
errorMsg.value = e.message;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
class="flex flex-col bg-gray-200/50 text-black w-full h-full absolute inset-0 justify-center align-middle text-center z-[20] backdrop-blur-sm"
|
||||
>
|
||||
<div v-if="!allowed && !error" class="m-2">
|
||||
{{ t("error") }}
|
||||
</div>
|
||||
<div v-if="error" class="m-2">
|
||||
<span>{{ errorMsg ? errorMsg : t("systemerror") }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<slot></slot>
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue