Nuxt 3 Middleware issue
middleware/auth.js
Dashboard.vue
- Navigate to is getting fired regardless if cookie value exist or not
- When cookie value exists it doesn't do console.log("cookie.value is none") still navigate to works
- I tried opening the dashboard from different url, it lands to /admin/login
2 Replies
nvm i found the solution turns out i need to make sure its running in server side
checking only if a cookie exists or not doesn't seem secure
you should be checking the cookie value if it's valid or not