how can we pass token in vuejs

this.axios
.get(this.getApiUrlByProcess(this.process, "get_categories"),
this.getAuthHeaders())



const query = this.getAuthHeaders();
let input = this.deleteEmptyKeys(this.customer);
this.axios
.post(this.$api.create_customer, input, query)
ss


getAuthHeaders: function() {
const user = this.getUserData();
const customer = $cookies.get("user.customer_slug");
if (user != (null || undefined)) {
this.$apiHeaders["headers"]["Authorization"] = "Bearer " + user.access_token;
this.$apiHeaders["headers"]["X-Customer"] = customer;
}
return this.$apiHeaders;
},






No comments:

Post a Comment

Event listening in react

 How we can listen to som eevents some envents fire like click or automatically user enters into input button , that is event on word type i...