mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Fixes potential login issue if password syncing is set to true
This commit is contained in:
parent
820d37cabb
commit
6c366eb112
|
@ -124,16 +124,18 @@ class AuthController extends Controller
|
||||||
return redirect()->back()->withInput()->withErrors($validator);
|
return redirect()->back()->withInput()->withErrors($validator);
|
||||||
}
|
}
|
||||||
$user = null;
|
$user = null;
|
||||||
|
|
||||||
// Should we even check for LDAP users?
|
// Should we even check for LDAP users?
|
||||||
if (Setting::getSettings()->ldap_enabled=='1') {
|
if (Setting::getSettings()->ldap_enabled=='1') {
|
||||||
LOG::debug("LDAP is enabled.");
|
LOG::debug("LDAP is enabled.");
|
||||||
try {
|
try {
|
||||||
$user = $this->login_via_ldap($request);
|
$user = $this->login_via_ldap($request);
|
||||||
Auth::login($user, true);
|
Auth::login($user, true);
|
||||||
|
|
||||||
|
// If the user was unable to login via LDAP, log the error and let them fall through to
|
||||||
|
// local authentication.
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
if(Setting::getSettings()->ldap_pw_sync!='1') {
|
LOG::error("There was an error authenticating the LDAP user: ".$e->getMessage());
|
||||||
return redirect()->back()->withInput()->with('error',$e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue