Answer the question
In order to leave comments, you need to log in
How to make authentication exclusively by token (Laravel Passport) in Laravel so that the email and password fields are completely removed from the model?
Hello.
I'm reading the documentation but I don't understand how can I make the token from Laravel Passport the ONLY ID in the system?
That is, the user came to the site - the application gives him a
token and says:
- Here is your token - now for me it is you
API to transfer (according to the documentation)
How to do this?
In the documentation examples, the email and password fields are everywhere, and I need authentication to be without them at all.
Thanks in advance for advice or links!
PS Details:
- A person accesses the site using a browser.
- The application looks for the presence of an authenticated session, and if there is no session, it automatically creates a user and immediately logs him in.
- Moreover, the ONLY user identifier is a random token (there is no login, no password, no email).
- The application informs the user of his token.
- And offers to log in under another token if he already has one (from the last time).
What is the best and easiest way to implement this?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question