Fix user swap broken in db4b901

This commit is contained in:
Deon George 2025-02-26 16:35:11 +11:00
parent f9bd352bfb
commit f20d9891f2
2 changed files with 5 additions and 5 deletions

View File

@ -40,10 +40,10 @@ class SwapinAuthUser
Config::set('ldap.connections.'.$key.'.password',Cookie::get('password_encrypt')); 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')]); 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. // 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); Container::getInstance()->addConnection(new Connection(config('ldap.connections.'.$key)),$key);
}
return $next($request); return $next($request);
} }

View File

@ -16,15 +16,15 @@ return Application::configure(basePath: dirname(__DIR__))
) )
->withMiddleware(function (Middleware $middleware) { ->withMiddleware(function (Middleware $middleware) {
$middleware->appendToGroup('web', [ $middleware->appendToGroup('web', [
SwapinAuthUser::class,
ApplicationSession::class, ApplicationSession::class,
SwapinAuthUser::class,
CheckUpdate::class, CheckUpdate::class,
]); ]);
$middleware->prependToGroup('api', [ $middleware->prependToGroup('api', [
EncryptCookies::class, EncryptCookies::class,
SwapinAuthUser::class,
ApplicationSession::class, ApplicationSession::class,
SwapinAuthUser::class,
]); ]);
$middleware->trustProxies(at: [ $middleware->trustProxies(at: [