Merge pull request #9247 from jakxnz/pulls/4/record-login-attempt-outputs

ENHANCEMENT: MemberAuthenticator::recordLoginAttempt() outputs
This commit is contained in:
Robbie Averill 2019-10-03 10:46:34 -07:00 committed by GitHub
commit e49cec3a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,13 +166,14 @@ class MemberAuthenticator implements Authenticator
* @param HTTPRequest $request
* @param Member $member
* @param boolean $success
* @return LoginAttempt|null
*/
protected function recordLoginAttempt($data, HTTPRequest $request, $member, $success)
{
if (!Security::config()->get('login_recording')
&& !Member::config()->get('lock_out_after_incorrect_logins')
) {
return;
return null;
}
// Check email is valid
@ -206,7 +207,12 @@ class MemberAuthenticator implements Authenticator
$attempt->Email = $email;
$attempt->IP = $request->getIP();
$this->invokeWithExtensions('updateLoginAttempt', $attempt, $data, $request);
$attempt->write();
return $attempt;
}
/**