Answer the question
In order to leave comments, you need to log in
How to do authentication using API?
Good evening everyone, I can not understand the principle of authorization in js. I send login and password to the server side (laravel, jwt) in response I get a token. Store the token in localstorage? and in the future, when making requests to the server, assign it to the header of the request in Authorization ? But what to do, the token is not eternal, when to update it? I can't understand how it works. I tried to google about how token-based authentication works, but found nothing. Please put me on the right path.
Thanks
Answer the question
In order to leave comments, you need to log in
The simplest yes ... login password, dragged the token. Token for each request in the header. When the token is out of date - then send the user to the login page. Or use refresh token. And in general, read about OAuth
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question