Answer the question
In order to leave comments, you need to log in
REACT with LARAVEL. How to do correctly and competently authorization?
Hello! I ask you to tell me about the correct implementation of the React application authorization in conjunction with LARAVEL PASSPORT. I don't really understand passport.
1. What should we get from the backend (LARAVEL PASSPORT) upon successful authentication?
In most examples, there is a user cell in localStorage. But I don't understand why you need to store user data there. Explain, please.
2. If our access token has expired, what should we do and how?
3. Index.js - how to check if the user is authorized and how to check the validity of the token.
Tell us more about everything, please.
Answer the question
In order to leave comments, you need to log in
Laravel Passport is an implementation of OAuth, you don't need to understand Passport, just understand OAuth and read the documentation.
1. What should we get from the backend (LARAVEL PASSPORT) upon successful authentication?This is stated in the OAuth specification and in the Passport documentation.
2. If our access token has expired, what should we do and how?This is stated in the OAuth specification and in the Passport documentation.
3. how to check the validity of the tokenBy making a request with this token to the backend or by looking at its lifetime. This is also stated in the OAuth specification and in the Passport documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question