PHP-054 / Advanced
Trusting two-factor authentication status solely through the session
Why is this a problem?
Skipping the OTP step and accessing /dashboard directly bypasses 2FA.
How to fix it
php
session(['2fa:pending' => $user->id]); // Auth::login and regenerate() only after OTP succeeds