Skip to content

Commit 086c34e

Browse files
author
Dario
committed
Remove registration limiter from view route. Add other limiters to config and adjust routes.php
1 parent ac0c3ed commit 086c34e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

config/fortify.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
'domain' => null,
1616
'limiters' => [
1717
'login' => null,
18+
'two-factor' => null,
19+
'registration' => null,
20+
'verification' => null,
1821
],
1922
'paths' => [
2023
'login' => null,

routes/routes.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@
7070
if (Features::enabled(Features::registration())) {
7171
if ($enableViews) {
7272
Route::get(RoutePath::for('register', '/register'), [RegisteredUserController::class, 'create'])
73-
->middleware(array_filter([
74-
'guest:'.config('fortify.guard'),
75-
$registrationLimiter ? 'throttle:'.$registrationLimiter : null,
76-
]))
73+
->middleware(['guest:'.config('fortify.guard')])
7774
->name('register');
7875
}
7976

@@ -93,11 +90,18 @@
9390
}
9491

9592
Route::get(RoutePath::for('verification.verify', '/email/verify/{id}/{hash}'), [VerifyEmailController::class, '__invoke'])
96-
->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard'), 'signed', 'throttle:'.$verificationLimiter])
93+
->middleware(array_filter([
94+
config('fortify.auth_middleware', 'auth').':'.config('fortify.guard'),
95+
'signed',
96+
$verificationLimiter ? 'throttle:'.$verificationLimiter : null,
97+
]))
9798
->name('verification.verify');
9899

99100
Route::post(RoutePath::for('verification.send', '/email/verification-notification'), [EmailVerificationNotificationController::class, 'store'])
100-
->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard'), 'throttle:'.$verificationLimiter])
101+
->middleware(array_filter([
102+
config('fortify.auth_middleware', 'auth').':'.config('fortify.guard'),
103+
$verificationLimiter ? 'throttle:'.$verificationLimiter : null,
104+
]))
101105
->name('verification.send');
102106
}
103107

0 commit comments

Comments
 (0)