Nik ⚡
Nik ⚡
Explore posts from servers
NNuxt
Created by Nik ⚡ on 5/23/2024 in #❓・help
Middleware doesn't work (well) when using async/await?!
No description
12 replies
NNuxt
Created by Nik ⚡ on 5/23/2024 in #❓・help
Getting access to cookies in middleware
Hi am building a very simple auth in Nuxt3. I am setting session cookies with jwt tokens in my login.post.ts endpoint. For the protected pages I am using a middleware, but I am struggling to get access to the cookies in the middleware. In the login endpoint I am setting the cookie with the h3 setCookie function. Can you please help and let me know how I access the cookie in the middleware now so I can validate the JWT? Thanks.
39 replies