Answer the question
In order to leave comments, you need to log in
How to change the registration process to SMS?
Now laravel-passport is used, but it emphasizes that the user must have an email and a password
. How can I make it so that there is only a telephone and code bundle (what comes with authorization)?
That is, it is assumed that the entrance is carried out only with the help of the phone number and the code that comes to the phone.
Or do you have to get rid of the passport and write something of your own?
Answer the question
In order to leave comments, you need to log in
Let's figure out what laravel passport is. In fact, this is a package that implements the connection via OAuth, that's it! He does not directly deal with login and everything else. In principle, with a certain implementation, you can also transfer a number with a code to it.
Regularly, authorization via SMS is not implemented, if you want to do this, then you need to write an authorization mechanism yourself that will expand (replace) the regular one. In the dock, how this is implemented, in a first approximation, is described how this is done. But still, are you sure that you need to leave only SMS authorization? In my projects, I still use a combined approach, where there is more than one authorization method, and based on what we entered in the login field, or what authorization methods are allowed, the corresponding logic is already being executed. For one single method of authorization in a number of cases is not good at all.
If you are firmly convinced that you want SMS and a code, and nothing more. Redefine the login field for authorization, and use the code as a password, that's all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question