When I log in after activating two factor, the field where I enter the verification key does not open. Login directly. What could my problem be caused by?
FortifyServiceProvider.php
public function boot()
{
Fortify::createUsersUsing(CreateNewUser::class);
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
RateLimiter::for('login', function (Request $request) {
return Limit::perMinute(5)->by($request->email.$request->ip());
});
RateLimiter::for('two-factor', function (Request $request) {
return Limit::perMinute(5)->by($request->session()->get('login.id'));
});
Fortify::confirmPasswordView(function (){
return view('user.pages.confirm-password');
});
Fortify::twoFactorChallengeView(function (){
return view('user.pages.two-factor-challenge');
});
}
fortify.php
'features' => [
Features::registration(),
Features::resetPasswords(),
// Features::emailVerification(),
Features::updateProfileInformation(),
Features::updatePasswords(),
Features::twoFactorAuthentication([
'confirmPassword' => true,
]),
],
route.php
Route::group(['middleware' => ['auth', 'roles:0'], 'prefix' => 'live'], function () {
Route::get('/dashboard', [DashboardController::class, 'index'])->name('user.dashboard');
Modals/User.php
namespace AppModels;
use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateFoundationAuthUser as Authenticatable;
use IlluminateNotificationsNotifiable;
use LaravelFortifyTwoFactorAuthenticatable;
class User extends Authenticatable
{
use Notifiable;
use TwoFactorAuthenticatable;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…