Hello everyone , I'm trying to make an API in laravel and frontend in nuxtjs. I made basic authentication system in laravel with sanctum and it is working with postman. But when i make a request from my frontend(nuxt app) it shows csrf token mismatch error. What should i do ?
You are hitting a route that is in your web.php file most probably and not in your api.php. That middleware is applied to the web group here, so make sure you are making calls properly.
Run php artisan route:list and you'll see which middleware is applied to the route you are trying to hit.