I have my backend in Laravel, working in server. Let it be: https://my-server.com
I have my vuejs application working in localhost.
I wanted to connect this application to the backend.
I started to change my .env
VUE_APP_DOMAIN = "localhost:8001"
VUE_APP_DESTINATION = "https://my-server.com/"
VUE_APP_API_URL = "https://my-server.com/"
VUE_APP_EMAIL = "[email protected]"
VUE_APP_SECRET_VERSION="1.0"
The first step was that I was getting CSRF Token Mismatch error.
I just need to test some data, so I changed my VerifyCSRFToken Middleware:
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'*'
];
}
But now, I can't get the user session. It gives 401 Unauthorized.
First question: As I'm justing making one small test, is it correct to avoid CSRF token like that example?
Second question: How can I test this correctly, getting the session as I want?