I am trying to build an API using Laravel sanctum token-based authentication. On postman, it works fine, and giving the desired output but for VueApp or any server running app, it is giving me an error response. Like below
CSRF token mismatch.
I Have two API Routes.
Route::post('/login',[App\http\controller\Api\MainController::class,'login']);
Route::post('/register',[App\http\controller\Api\MainController::class,'register']);
When hitting these endpoints with the postman, I am getting the desired output as the response, But When trying to the same with Vue/CLI application using Axios, getting the below response...
CSRF token mismatch.