Skip to content

Commit

Permalink
chore: fix axios
Browse files Browse the repository at this point in the history
  • Loading branch information
khalifan-kfan committed May 23, 2024
1 parent 397501c commit cf2cb3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/axios.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import { API_BASE_URL, ACTIVITY_LOGS_API_URL, MONITORING_API_URL } from "./config";

const token = localStorage.getItem("token");


// Create main backend axios instance
const instance = axios.create({
Expand All @@ -18,6 +18,8 @@ const monitoringAxios = axios.create({
});

// Set default headers
const token = localStorage.getItem("token");
instance.defaults.headers.Authorization = `Bearer ${token}`;
userActivityLoggerAxios.defaults.headers.Authorization = `Bearer ${token}`;
monitoringAxios.defaults.headers.Authorization = `Bearer ${token}`;

Expand Down

0 comments on commit cf2cb3c

Please sign in to comment.