|
35 | 35 | $twoFactorLimiter = config('fortify.limiters.two-factor');
|
36 | 36 | $verificationLimiter = config('fortify.limiters.verification', '6,1');
|
37 | 37 |
|
38 |
| - Route::post(RoutePath::for('login', '/login'), [AuthenticatedSessionController::class, 'store']) |
| 38 | + $login = Route::post(RoutePath::for('login', '/login'), [AuthenticatedSessionController::class, 'store']) |
39 | 39 | ->middleware(array_filter([
|
40 | 40 | 'guest:'.config('fortify.guard'),
|
41 | 41 | $limiter ? 'throttle:'.$limiter : null,
|
42 | 42 | ]));
|
43 | 43 |
|
| 44 | + if (! $enableViews) { |
| 45 | + $login->name('login'); |
| 46 | + } |
| 47 | + |
44 | 48 | Route::post(RoutePath::for('logout', '/logout'), [AuthenticatedSessionController::class, 'destroy'])
|
45 | 49 | ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')])
|
46 | 50 | ->name('logout');
|
|
74 | 78 | ->name('register');
|
75 | 79 | }
|
76 | 80 |
|
77 |
| - Route::post(RoutePath::for('register', '/register'), [RegisteredUserController::class, 'store']) |
| 81 | + $register = Route::post(RoutePath::for('register', '/register'), [RegisteredUserController::class, 'store']) |
78 | 82 | ->middleware(['guest:'.config('fortify.guard')]);
|
| 83 | + |
| 84 | + if (! $enableViews) { |
| 85 | + $register->name('register'); |
| 86 | + } |
79 | 87 | }
|
80 | 88 |
|
81 | 89 | // Email Verification...
|
|
112 | 120 | // Password Confirmation...
|
113 | 121 | if ($enableViews) {
|
114 | 122 | Route::get(RoutePath::for('password.confirm', '/user/confirm-password'), [ConfirmablePasswordController::class, 'show'])
|
115 |
| - ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')]); |
| 123 | + ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')]) |
| 124 | + ->name('password.confirm'); |
116 | 125 | }
|
117 | 126 |
|
118 | 127 | Route::get(RoutePath::for('password.confirmation', '/user/confirmed-password-status'), [ConfirmedPasswordStatusController::class, 'show'])
|
119 | 128 | ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')])
|
120 | 129 | ->name('password.confirmation');
|
121 | 130 |
|
122 |
| - Route::post(RoutePath::for('password.confirm', '/user/confirm-password'), [ConfirmablePasswordController::class, 'store']) |
123 |
| - ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')]) |
124 |
| - ->name('password.confirm'); |
| 131 | + $passwordConfirm = Route::post(RoutePath::for('password.confirm', '/user/confirm-password'), [ConfirmablePasswordController::class, 'store']) |
| 132 | + ->middleware([config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')]); |
| 133 | + |
| 134 | + if (! $enableViews) { |
| 135 | + $passwordConfirm->name('password.confirm'); |
| 136 | + } |
125 | 137 |
|
126 | 138 | // Two Factor Authentication...
|
127 | 139 | if (Features::enabled(Features::twoFactorAuthentication())) {
|
|
131 | 143 | ->name('two-factor.login');
|
132 | 144 | }
|
133 | 145 |
|
134 |
| - Route::post(RoutePath::for('two-factor.login', '/two-factor-challenge'), [TwoFactorAuthenticatedSessionController::class, 'store']) |
| 146 | + $twoFactorLogin = Route::post(RoutePath::for('two-factor.login', '/two-factor-challenge'), [TwoFactorAuthenticatedSessionController::class, 'store']) |
135 | 147 | ->middleware(array_filter([
|
136 | 148 | 'guest:'.config('fortify.guard'),
|
137 | 149 | $twoFactorLimiter ? 'throttle:'.$twoFactorLimiter : null,
|
138 | 150 | ]));
|
139 | 151 |
|
| 152 | + if (! $enableViews) { |
| 153 | + $twoFactorLogin->name('two-factor.login'); |
| 154 | + } |
| 155 | + |
140 | 156 | $twoFactorMiddleware = Features::optionEnabled(Features::twoFactorAuthentication(), 'confirmPassword')
|
141 | 157 | ? [config('fortify.auth_middleware', 'auth').':'.config('fortify.guard'), 'password.confirm']
|
142 | 158 | : [config('fortify.auth_middleware', 'auth').':'.config('fortify.guard')];
|
|
0 commit comments