Initial commit
This commit is contained in:
28
app/Http/Middleware/ConditionalAuthenticateSession.php
Normal file
28
app/Http/Middleware/ConditionalAuthenticateSession.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Laravel\Jetstream\Http\Middleware\AuthenticateSession;
|
||||
|
||||
class ConditionalAuthenticateSession
|
||||
{
|
||||
protected $authenticateSession;
|
||||
|
||||
public function __construct(AuthenticateSession $authenticateSession)
|
||||
{
|
||||
$this->authenticateSession = $authenticateSession;
|
||||
}
|
||||
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
// Skip AuthenticateSession middleware in Docker environment
|
||||
// as it causes session validation issues with session migration
|
||||
if (env('IS_DOCKER', false)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
return $this->authenticateSession->handle($request, $next);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user