3

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.