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')
// }
}) |
Beta Was this translation helpful? Give feedback.
Answered by
pratamatama
Nov 11, 2023
Replies: 1 comment
-
Nevermind, how i check was the culprit. This package works just fine! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pratamatama
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!