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

How to Connect Firebase Using Pyrebase In Python

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

How to Connect Django With PostgreSql / Mysql / Oracel Database