Cesxhin
Cesxhin
NNuxt
Created by Cesxhin on 8/19/2024 in #❓・help
Problem generic typescript
why now i get error for i18n and lodash for typescirpt? Property '$t' does not exist on type '{ $: ComponentInternalInstance; $data:[...] Property 'useGet' does not exist on type '{ $: ComponentInternalInstance; $data:[...]
8 replies
NNuxt
Created by Cesxhin on 6/12/2024 in #❓・help
It doesn't block passed requests when I have a middleware that checks whether you are authenticated.
I installed plugin nuxt security and i set tokensPerInterval: 1000 and interval: 60000.
export default defineEventHandler((event) => {
const notRequireAuth = ["/api/public"];
const {auth} = parseCookies(event);
const path = event.path;

if(startsWith(path, "/api")){
if(isEmpty(find(notRequireAuth, (url) => path.indexOf(url) !== -1))){
if(isNil(auth)){
throw createError({
statusCode: 401,
statusMessage: "You aren't authenticated"
});
}
}
}
});
export default defineEventHandler((event) => {
const notRequireAuth = ["/api/public"];
const {auth} = parseCookies(event);
const path = event.path;

if(startsWith(path, "/api")){
if(isEmpty(find(notRequireAuth, (url) => path.indexOf(url) !== -1))){
if(isNil(auth)){
throw createError({
statusCode: 401,
statusMessage: "You aren't authenticated"
});
}
}
}
});
How block with "too many request" also form this middleware?
1 replies
NNuxt
Created by Cesxhin on 5/15/2024 in #❓・help
Problem typescript with modules
When launch "npm run typecheck" not detected correct also the folders inside modules. Solution?
3 replies
NNuxt
Created by Cesxhin on 4/11/2024 in #❓・help
[RESOLVED] Problem with modules
No description
4 replies
NNuxt
Created by Cesxhin on 4/8/2024 in #❓・help
[RESOLVED] Vue Warning Hydration
No description
7 replies
NNuxt
Created by Cesxhin on 4/5/2024 in #❓・help
[RESOLVED] I need await on start up of app.vue
I would like to wait until it has finished loading all the essential data to be able to proceed with using the application, what is the best practice? I'm currently using a plugin and until it enters onMounted the layout and page aren't shown.
<template>
<NuxtLayout v-if="finish">
<NuxtPage />
</NuxtLayout>
</template>

<script setup lang="ts">
const finish = ref(false);
onMounted(() => finish.value = true)
</script>
<template>
<NuxtLayout v-if="finish">
<NuxtPage />
</NuxtLayout>
</template>

<script setup lang="ts">
const finish = ref(false);
onMounted(() => finish.value = true)
</script>
56 replies