Skip to content

Commit a3944cf

Browse files
forgot password add throttle
1 parent 3a6ed96 commit a3944cf

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Diff for: config/auth.php

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
'provider' => 'users',
9292
'table' => 'password_resets',
9393
'expire' => 60,
94+
'throttle' => 60,
9495
],
9596
],
9697
];

Diff for: src/MicroweberPackages/User/routes/api.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@
100100
Route::any('logout', 'UserLoginController@logout')->name('logout');
101101
Route::post('register', 'UserRegisterController@register')->name('register')->middleware(['allowed_ips']);
102102

103-
Route::post('/forgot-password', 'UserForgotPasswordController@send')->name('password.email');
103+
Route::post('/forgot-password', 'UserForgotPasswordController@send')
104+
->middleware(['throttle:3,1'])
105+
->name('password.email');
104106
Route::post('/reset-password', 'UserForgotPasswordController@update')->name('password.update');
105107

106108
Route::post('/profile-update', 'UserProfileController@update')->name('profile.update');

Diff for: src/MicroweberPackages/User/routes/web.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
Route::post('email/verify-resend/{id}/{hash}', 'UserVerifyController@sendVerifyEmail')->name('verification.send');
4141

4242
Route::get('/forgot-password', 'UserForgotPasswordController@showForgotForm')->name('password.request');
43-
Route::post('/forgot-password', 'UserForgotPasswordController@send')->name('password.email');
43+
Route::post('/forgot-password', 'UserForgotPasswordController@send')
44+
->middleware(['throttle:3,1'])
45+
->name('password.email');
4446

4547
Route::get('/reset-password/{token}', 'UserForgotPasswordController@showResetForm')->name('password.reset');
4648
Route::post('/reset-password', 'UserForgotPasswordController@update')->name('password.update');

0 commit comments

Comments
 (0)