DEV Community

Discussion on: How To Add Google's Two Factor Authentication To A Laravel 8 Application.

Collapse
 
tadio profile image
Andrea Tadioli

Hi, I have the same problem.
But I think that is the solution. In routes/web.php I add this:

Route::middleware(['2fa'])->group(function () {
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'],)->name('home');
Route::post('/2fa', function () {
return redirect(route('home'));
})->name('2fa');
});

and run correctly for me.
;-)

Collapse
 
christine927t profile image
Christine Treacy

Thanks for adding this, it helped me a lot!