Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

slpysiren's avatar

Mixing Fortify and starter kit authentication

I'm fairly new to Laravel, I've worked on a fairly antiquated PHP and Vue2 codebase but my current project is using Laravel 12 and the Vue starter kit. I was hoping I would get by using the provided user authentication so I wouldn't have to go through the hassle of making my own. Now I want to add 2FA using Fortify. I've made a page where a user can confirm their password, generate the qr code, and confirm an OTP to enable 2FA, but I'm a bit stuck at the stage of requiring it when logging in.

Currently the auth flow is fully stock starter kit, I have a page to enter the OTP and I have set it as the twoFactorChallengeView, and I haven't changed the login POST route. I assume I can change the AuthenticatedSessionController.php to check for the 2FA and redirect to the challenge page but I feel I'm working against the intended flow of Fortify.

Is there a "proper" way to integrate just the 2FA part of Fortify into the starter kit auth?

Thanks.

0 likes
2 replies
jlrdw's avatar

Have you tried to just use fortify only?

slpysiren's avatar

@jlrdw I was hoping to not have to use Fortify only as I'd have to spend time switching out the existing auth. It wouldn't be the end of the world but highly preferable if I didn't have to.

Please or to participate in this conversation.