Only swap in user's credentials if the requested page is not the logout page. This avoids an issue if the user's credentials are changed during their session, they couldnt log out

This commit is contained in:
Deon George 2025-06-09 10:31:25 +10:00
parent 33d96940e6
commit 8602c2b17f

View File

@ -29,7 +29,7 @@ class SwapinAuthUser
if (! array_key_exists($key,config('ldap.connections')))
abort(599,sprintf('LDAP default server [%s] configuration doesnt exist?',$key));
if (Session::has('username_encrypt') && Session::has('password_encrypt')) {
if (($request->path() !== 'logout') && Session::has('username_encrypt') && Session::has('password_encrypt')) {
Config::set('ldap.connections.'.$key.'.username',Crypt::decryptString(Session::get('username_encrypt')));
Config::set('ldap.connections.'.$key.'.password',Crypt::decryptString(Session::get('password_encrypt')));