Everywhere you read that storing an access_token in the local storage is not good, but that you must use a secure and httponly cookie which is saver.
Now I have an acces_token in the cookie and I can post it to Laravel passport and then I receive the user data.
-
Check if acces_token cookie exist => axios call
-
If not set secure and httponly cookie with the value acces_token
- Get acces_token => axios call to server to read the cookie and get the user data from the database and return name for example
Is this the right way and do I always have to make a call to the server to receive the user data?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire