From f20d9891f26bf4a5184f42d9c519589cbc570e9c Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 26 Feb 2025 16:35:11 +1100 Subject: [PATCH] Fix user swap broken in db4b901 --- app/Http/Middleware/SwapinAuthUser.php | 6 +++--- bootstrap/app.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Middleware/SwapinAuthUser.php b/app/Http/Middleware/SwapinAuthUser.php index c57a6158..9a07a449 100644 --- a/app/Http/Middleware/SwapinAuthUser.php +++ b/app/Http/Middleware/SwapinAuthUser.php @@ -40,11 +40,11 @@ class SwapinAuthUser Config::set('ldap.connections.'.$key.'.password',Cookie::get('password_encrypt')); Log::debug('Swapping out configured LDAP credentials with the user\'s cookie.',['key'=>$key,'user'=>Cookie::get('username_encrypt')]); - - // We need to override our Connection object so that we can store and retrieve the logged in user and swap out the credentials to use them. - Container::getInstance()->addConnection(new Connection(config('ldap.connections.'.$key)),$key); } + // We need to override our Connection object so that we can store and retrieve the logged in user and swap out the credentials to use them. + Container::getInstance()->addConnection(new Connection(config('ldap.connections.'.$key)),$key); + return $next($request); } } \ No newline at end of file diff --git a/bootstrap/app.php b/bootstrap/app.php index 9115ee6d..821d7eb0 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -16,15 +16,15 @@ return Application::configure(basePath: dirname(__DIR__)) ) ->withMiddleware(function (Middleware $middleware) { $middleware->appendToGroup('web', [ - SwapinAuthUser::class, ApplicationSession::class, + SwapinAuthUser::class, CheckUpdate::class, ]); $middleware->prependToGroup('api', [ EncryptCookies::class, - SwapinAuthUser::class, ApplicationSession::class, + SwapinAuthUser::class, ]); $middleware->trustProxies(at: [