mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Add IP to failed login message.
This commit is contained in:
@@ -80,9 +80,10 @@ class UnknownUserLoginAttempt extends Notification
|
||||
{
|
||||
$settings = ReturnsSettings::getSettings('ntfy', 'owner', null);
|
||||
$message = new Message();
|
||||
$ip = Request::ip();
|
||||
$message->topic($settings['ntfy_topic']);
|
||||
$message->title((string) trans('email.unknown_user_subject'));
|
||||
$message->body((string) trans('email.unknown_user_message', ['address' => $this->address]));
|
||||
$message->body((string) trans('email.unknown_user_message', ['address' => $this->address, 'ip' =>$ip]));
|
||||
|
||||
return $message;
|
||||
}
|
||||
@@ -92,7 +93,9 @@ class UnknownUserLoginAttempt extends Notification
|
||||
*/
|
||||
public function toPushover(OwnerNotifiable $notifiable): PushoverMessage
|
||||
{
|
||||
return PushoverMessage::create((string) trans('email.unknown_user_message', ['address' => $this->address]))
|
||||
$ip = Request::ip();
|
||||
|
||||
return PushoverMessage::create((string) trans('email.unknown_user_message', ['address' => $this->address, 'ip' =>$ip]))
|
||||
->title((string) trans('email.unknown_user_subject'))
|
||||
;
|
||||
}
|
||||
@@ -102,8 +105,9 @@ class UnknownUserLoginAttempt extends Notification
|
||||
*/
|
||||
public function toSlack(OwnerNotifiable $notifiable): SlackMessage
|
||||
{
|
||||
$ip = Request::ip();
|
||||
return new SlackMessage()->content(
|
||||
(string) trans('email.unknown_user_body', ['address' => $this->address])
|
||||
(string) trans('email.unknown_user_body', ['address' => $this->address, 'ip' => $ip])
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -64,8 +64,8 @@ return [
|
||||
|
||||
// unknown user login attempt
|
||||
'unknown_user_subject' => 'An unknown user tried to log in',
|
||||
'unknown_user_body' => 'An unknown user tried to log in to Firefly III. The email address they used was ":address".',
|
||||
'unknown_user_message' => 'The email address they used was ":address".',
|
||||
'unknown_user_body' => 'An unknown user (:ip) tried to log in to Firefly III. The email address they used was ":address".',
|
||||
'unknown_user_message' => 'The email address they (:ip) used was ":address".',
|
||||
|
||||
// known user login attempt
|
||||
'failed_login_subject' => 'Firefly III detected a failed login attempt',
|
||||
|
Reference in New Issue
Block a user