samedi 21 décembre 2019

Vuejs and Laravel Passport acces_token procedure

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.

  1. Check if acces_token cookie exist => axios call

  2. If not set secure and httponly cookie with the value acces_token

  3. 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