How to Use Static Authentication Token In Vuejs

1) if you stroed Token in Localstore  then get token from Localstoreage and use in your application.

axios.defaults.headers = { 
Authorization: `Bearer ${localStorage.getItem('token')}`,
'Content-Type': 'application/json' }


2) You can added static token instated of your_token place.

axios.defaults.headers = { 
Authorization: `Bearer + 'your_token'`,
'Content-Type': 'application/json' }

Note: you need to add above links before calling of Axios funtion.


Comments

Popular posts from this blog

ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line

How To Convert Html File/URL/String Into Image Using Python

How to get Full URL or get absolute url In Django