πŸ–€ SHADXW πŸ–€
πŸ–€ SHADXW πŸ–€
NNuxt
Created by πŸ–€ SHADXW πŸ–€ on 10/28/2024 in #❓・help
nuxt Why is it when I work with nuxt I ALWAYS GET PROBLEMSSS
Maybe in the future it can be good but idk this is game breaking stuff man. I ended up switching to hono instead.
9 replies
NNuxt
Created by πŸ–€ SHADXW πŸ–€ on 10/28/2024 in #❓・help
nuxt Why is it when I work with nuxt I ALWAYS GET PROBLEMSSS
Honestly I'm sick and tired of this breaking framework. I always have small issues. Sometimes it broke the transition so it didn't animate. And now this. Idk. This framework is bleeding edge and not a stable framework.
9 replies
NNuxt
Created by πŸ–€ SHADXW πŸ–€ on 10/28/2024 in #❓・help
nuxt Why is it when I work with nuxt I ALWAYS GET PROBLEMSSS
And the db works fine in compass so idk
9 replies
NNuxt
Created by πŸ–€ SHADXW πŸ–€ on 4/8/2024 in #❓・help
Pinia vscode retuning null in editor
Nvm I added a type to my store and now it works
2 replies
NNuxt
Created by netwrx on 3/29/2024 in #❓・help
No session created - nuxt auth utils
Here is how I do it.
export default defineNuxtRouteMiddleware(async (to, from) => {
const userStore = useUserStore();

interface AuthData {
auth: boolean;
}

const { data } = await useAsyncData('auth', async () => {
const { data } = await useFetch<AuthData>('/api/auth', {
credentials: 'include',
});
return data.value;
});

if (data.value) {
userStore.$patch({ auth: data.value.auth });
}

if (!userStore.auth) {
return navigateTo({ path: '/login' });
}
});
export default defineNuxtRouteMiddleware(async (to, from) => {
const userStore = useUserStore();

interface AuthData {
auth: boolean;
}

const { data } = await useAsyncData('auth', async () => {
const { data } = await useFetch<AuthData>('/api/auth', {
credentials: 'include',
});
return data.value;
});

if (data.value) {
userStore.$patch({ auth: data.value.auth });
}

if (!userStore.auth) {
return navigateTo({ path: '/login' });
}
});
Might give you some help I hope
47 replies