mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Error when blocked user logs in
This commit is contained in:
@@ -73,7 +73,7 @@ class AuthController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if user is blocked:
|
// check if user is blocked:
|
||||||
$message = '';
|
$errorMessage = '';
|
||||||
/** @var User $foundUser */
|
/** @var User $foundUser */
|
||||||
$foundUser = User::where('email', $credentials['email'])->where('blocked', 1)->first();
|
$foundUser = User::where('email', $credentials['email'])->where('blocked', 1)->first();
|
||||||
if (!is_null($foundUser)) {
|
if (!is_null($foundUser)) {
|
||||||
@@ -83,7 +83,7 @@ class AuthController extends Controller
|
|||||||
if (strlen($code) == 0) {
|
if (strlen($code) == 0) {
|
||||||
$code = 'general_blocked';
|
$code = 'general_blocked';
|
||||||
}
|
}
|
||||||
$message = strval(trans('firefly.' . $code . '_error', ['email' => $credentials['email']]));
|
$errorMessage = strval(trans('firefly.' . $code . '_error', ['email' => $credentials['email']]));
|
||||||
|
|
||||||
Log::debug('User "'.$credentials['email'].'" found, but code '.$code);
|
Log::debug('User "'.$credentials['email'].'" found, but code '.$code);
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class AuthController extends Controller
|
|||||||
'user_id' => $foundUser->id,
|
'user_id' => $foundUser->id,
|
||||||
'user_address' => $credentials['email'],
|
'user_address' => $credentials['email'],
|
||||||
'code' => $code,
|
'code' => $code,
|
||||||
'message' => $message,
|
'error_message' => $errorMessage,
|
||||||
'ip' => $request->ip(),
|
'ip' => $request->ip(),
|
||||||
];
|
];
|
||||||
Log::debug('Try to send error about user "'.$credentials['email'].'".');
|
Log::debug('Try to send error about user "'.$credentials['email'].'".');
|
||||||
@@ -116,7 +116,7 @@ class AuthController extends Controller
|
|||||||
$this->incrementLoginAttempts($request);
|
$this->incrementLoginAttempts($request);
|
||||||
}
|
}
|
||||||
Log::debug('User "'.$credentials['email'].'" return failed login response.');
|
Log::debug('User "'.$credentials['email'].'" return failed login response.');
|
||||||
return $this->sendFailedLoginResponse($request, $message);
|
return $this->sendFailedLoginResponse($request, $errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
The blocked code was "{{ code }}" and the subsequent message was:
|
The blocked code was "{{ code }}" and the subsequent message was:
|
||||||
</p>
|
</p>
|
||||||
<p style="font-family: monospace;font-size:13px;">
|
<p style="font-family: monospace;font-size:13px;">
|
||||||
"{{ message }}"
|
"{{ error_message }}"
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">
|
<p style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:11px;color:#aaa;">
|
||||||
|
@@ -3,6 +3,6 @@ Hey there,
|
|||||||
Firefly III has just blocked a login from user #{{ user_id }} ({{ user_address }}).
|
Firefly III has just blocked a login from user #{{ user_id }} ({{ user_address }}).
|
||||||
|
|
||||||
The blocked code was "{{ code }}" and the subsequent message was:
|
The blocked code was "{{ code }}" and the subsequent message was:
|
||||||
"{{ message }}"
|
"{{ error_message }}"
|
||||||
|
|
||||||
The login attempt came from IP {{ ip }}
|
The login attempt came from IP {{ ip }}
|
||||||
|
Reference in New Issue
Block a user