mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Update message to include IP
This commit is contained in:
@@ -67,9 +67,10 @@ class UserFailedLoginAttempt extends Notification
|
||||
{
|
||||
$settings = ReturnsSettings::getSettings('ntfy', 'user', $notifiable);
|
||||
$message = new Message();
|
||||
$ip = Request::ip();
|
||||
$message->topic($settings['ntfy_topic']);
|
||||
$message->title((string) trans('email.failed_login_subject'));
|
||||
$message->body((string) trans('email.failed_login_message', ['email' => $this->user->email]));
|
||||
$message->body((string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]));
|
||||
|
||||
return $message;
|
||||
}
|
||||
@@ -79,7 +80,8 @@ class UserFailedLoginAttempt extends Notification
|
||||
*/
|
||||
public function toPushover(User $notifiable): PushoverMessage
|
||||
{
|
||||
return PushoverMessage::create((string) trans('email.failed_login_message', ['email' => $this->user->email]))
|
||||
$ip = Request::ip();
|
||||
return PushoverMessage::create((string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]))
|
||||
->title((string) trans('email.failed_login_subject'))
|
||||
;
|
||||
}
|
||||
@@ -89,7 +91,8 @@ class UserFailedLoginAttempt extends Notification
|
||||
*/
|
||||
public function toSlack(User $notifiable): SlackMessage
|
||||
{
|
||||
$message = (string) trans('email.failed_login_message', ['email' => $this->user->email]);
|
||||
$ip = Request::ip();
|
||||
$message = (string) trans('email.failed_login_message', ['ip' => $ip, 'email' => $this->user->email]);
|
||||
|
||||
return new SlackMessage()->content($message);
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ return [
|
||||
// known user login attempt
|
||||
'failed_login_subject' => 'Firefly III detected a failed login attempt',
|
||||
'failed_login_body' => 'Firefly III detected that somebody (you?) failed to login with your account ":email". Please verify that this was you.',
|
||||
'failed_login_message' => 'A failed login attempt on your Firefly III account ":email" was detected.',
|
||||
'failed_login_message' => 'A failed login attempt (:ip) on your Firefly III account ":email" was detected.',
|
||||
'failed_login_warning' => 'If you recognize this IP address or the login attempt, you can ignore this message. If you didn\'t try to login, of if you have no idea what this is about, verify your password security, change it, and log out all other sessions. To do this, go to your profile page. Of course you have 2FA enabled already, right? Stay safe!',
|
||||
|
||||
// registered
|
||||
|
Reference in New Issue
Block a user