Vlad2017-09-20 14:30:26
Vlad, 2017-09-20 14:30:26

2-factor authentication on Laravel?

Hello dear programmers :)
There was a task to make double authentication on the site using SMS. I looked towards sms.ru, rummaged through the library under php laravel, everything is clear and great. But an important step remained - the implementation of the process.
How I imagine it: the user enters a login and password -> if successful, then redirect to a page with a field for entering a password from SMS -> if this is successful, then redirect to the profile.
What is the correct way to change the basic behavior of laravel auth ? Maybe you had experience or interesting examples and links?
I will be glad for any help! Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
JhaoDa, 2017-09-20

Why should the authentication mechanism do this? Catch events Illuminate\Auth\Events\Attempting, Illuminate\Auth\Events\Authenticatedand redirect where you need / do what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question