This repository was archived by the owner on Mar 5, 2025. It is now read-only.
User object is undefined inside Nuxt Middleware, is this intended? #133
|
Hi! I'm trying to make a middleware based on the currently logged in user data but I found that inside the middleware, the
export default defineNuxtRouteMiddleware(() => {
const { user } = useAuth()
const hasFilledIntroductoryForm = user.value && user.value.tosAgreed // TODO: add more prop checks
console.log({ hasFilledIntroductoryForm }) // { hasFilledIntroductoryForm: undefined }
// if (hasFilledIntroductoryForm) {
// return navigateTo('/dashboard')
// }
}) |
Answered by
furatamasensei
Nov 11, 2023
Replies: 1 comment
|
Nevermind, how i check was the culprit. This package works just fine! |
0 replies
Answer selected by
furatamasensei
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, how i check was the culprit. This package works just fine!