Skip to content

Commit

Permalink
Merge pull request #44 from nadhifikbarw/tfa-routes-patch
Browse files Browse the repository at this point in the history
[1.x] Only register two-factor-challenge routes if TFA feature enabled
  • Loading branch information
taylorotwell authored Sep 17, 2020
2 parents 5b4550e + c5ad6ed commit eb3e534
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions routes/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@
$limiter ? 'throttle:'.$limiter : null,
]));

Route::get('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'create'])
->middleware(['guest'])
->name('two-factor.login');

Route::post('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'store'])
->middleware(['guest']);

Route::post('/logout', [AuthenticatedSessionController::class, 'destroy'])
->name('logout');

Expand Down Expand Up @@ -112,6 +105,13 @@

// Two Factor Authentication...
if (Features::enabled(Features::twoFactorAuthentication())) {
Route::get('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'create'])
->middleware(['guest'])
->name('two-factor.login');

Route::post('/two-factor-challenge', [TwoFactorAuthenticatedSessionController::class, 'store'])
->middleware(['guest']);

$twoFactorMiddleware = Features::optionEnabled(Features::twoFactorAuthentication(), 'confirmPassword')
? ['auth', 'password.confirm']
: ['auth'];
Expand Down

0 comments on commit eb3e534

Please sign in to comment.