Skip to content

Commit 6309908

Browse files
committed
moved password recovery lang strings to base file
No need to have a separate lang file just for this.
1 parent 2b624a1 commit 6309908

File tree

8 files changed

+33
-30
lines changed

8 files changed

+33
-30
lines changed

src/app/Http/Middleware/ThrottlePasswordRecovery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ThrottlePasswordRecovery extends ThrottleRequests
1919
protected function buildException($request, $key, $maxAttempts, $responseCallback = null)
2020
{
2121
return ValidationException::withMessages([
22-
'email' => [trans('backpack::passwords.throttled_request')],
22+
'email' => [trans('backpack::base.throttled_request')],
2323
]);
2424
}
2525
}

src/app/Library/Auth/PasswordBroker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class PasswordBroker extends OriginalPasswordBroker
1414
{
15-
public const RESET_THROTTLED = 'backpack::passwords.throttled';
15+
public const RESET_THROTTLED = 'backpack::base.throttled';
1616

1717
/**
1818
* Send a password reset link to a user.

src/config/backpack/base.php

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,6 @@
193193
// Warning: if you disable this, the password recovery routes (below) will be disabled too!
194194
'setup_auth_routes' => true,
195195

196-
// Set this to false if you would like to skip adding the password recovery routes
197-
// (you then need to manually define the routes in your web.php)
198-
'setup_password_recovery_routes' => true,
199-
200-
// the ThrottleRequests Laravel middleware is used to prevent abuse from your recovery password functionality.
201-
// here you can configure how many attempts a user can make to recover the password in a given time.
202-
203-
// how much time to wait between password reset request notification ? User should be allow to attempt 1 request every: ? (defaults to 1 request every 60 seconds)
204-
// this is the time to wait for the email to arrive before trying to reset again
205-
'password_recovery_throttle_notifications' => 60, // time in seconds
206-
207-
// how many times in any given time period should the user be allowed to attempt a password reset? (defaults to 2,5 - 2 times every 5 minutes.)
208-
// take into account that user migth wrongly type an email at first, is plausible, so atleast allow one more shoot.
209-
'password_recovery_throttle_access' => '2,5', // 2 - how many times // 5 - interval in minutes
210-
211196
// Set this to false if you would like to skip adding the dashboard routes
212197
// (you then need to overwrite the login route on your AuthController)
213198
'setup_dashboard_routes' => true,
@@ -216,6 +201,31 @@
216201
// (you then need to manually define the routes in your web.php)
217202
'setup_my_account_routes' => true,
218203

204+
// Set this to false if you would like to skip adding the password recovery routes
205+
// (you then need to manually define the routes in your web.php)
206+
'setup_password_recovery_routes' => true,
207+
208+
/*
209+
|--------------------------------------------------------------------------
210+
| Security
211+
|--------------------------------------------------------------------------
212+
*/
213+
214+
// Backpack will prevent visitors from requesting password recovery too many times
215+
// for a certain email, to make sure they cannot be spammed that way.
216+
// How many seconds should a visitor wait, after they've requested a
217+
// password reset, before they can try again for the same email?
218+
'password_recovery_throttle_notifications' => 60, // time in seconds
219+
220+
// Backpack will prevent an IP from trying to reset the password too many times,
221+
// so that a malicious actor cannot try too many emails, too see if they have
222+
// accounts or to increase the AWS/SendGrid/etc bill.
223+
//
224+
// How many times in any given time period should the user be allowed to
225+
// attempt a password reset? Take into account that user might wrongly
226+
// type an email at first, so at least allow one more try.
227+
'password_recovery_throttle_access' => '2,5', // (defaults to 2,5 - 2 times every 5 minutes)
228+
219229
/*
220230
|--------------------------------------------------------------------------
221231
| Authentication

src/resources/lang/en/base.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,7 @@
6666
'confirm_email' => 'Confirm Email',
6767
'choose_new_password' => 'Choose New Password',
6868
'confirm_new_password' => 'Confirm new password',
69+
'throttled' => 'You have already requested a password reset recently. Please check your email. If you do not receive our email, please retry later.',
70+
'throttled_request' => 'You have exceeded the limit of tries. Please wait a few minutes and try again.',
6971

7072
];

src/resources/lang/en/passwords.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/resources/lang/pt/base.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
'confirm_email' => 'Confirmar Email',
6767
'choose_new_password' => 'Escolher nova password',
6868
'confirm_new_password' => 'Confirmar nova password',
69-
69+
'throttled' => 'Foi efectuado um pedido de recuperação de password recentemente. Verifique o seu email.',
70+
'throttled_request' => 'Excedeu o limite de tentativas. Aguarde alguns minutos e tente novamente.',
7071
];

src/resources/lang/pt/passwords.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/resources/lang/ro/base.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@
5757
'button' => 'Schimbă parola',
5858
'notice' => 'Dacă nu ați facut dvs cererea, nu este nevoie să faceți nimic, parola nu va fi schimbată.',
5959
],
60+
'throttled' => 'Ați cerut deja schimbarea parolei, de curând. Verificați email-ul primit pentru instrucțiuni. Dacă nu primiți email-ul, vă rugăm să încercați mai târziu.',
61+
'throttled_request' => 'Ați depășit limita de încercări. Așteptați câteva minute, apoi încercați din nou.',
6062
];

0 commit comments

Comments
 (0)