URL: http://github.com/codeCraft-Ritik/Elevate-AI/commit/b06a9d66e851ac06776a55ab19b0e423cb090eb7
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 344c2a0 commit b06a9d6Copy full SHA for b06a9d6
1 file changed
src/api/axios.js
@@ -1,14 +1,14 @@
1
+// src/api/axios.js
2
import axios from 'axios';
3
4
const API = axios.create({
- // VITE_API_URL should be set to https://elevate-ai-2.onrender.com/api in your Render settings
5
- baseURL: import.meta.env.VITE_API_URL || 'http://localhost:5000/api',
+ baseURL: 'http://localhost:5000/api',
6
});
7
8
API.interceptors.request.use((config) => {
9
- const token = localStorage.getItem('token');
+ const token = localStorage.getItem('token'); // This must match the key used in Login.jsx
10
if (token) {
11
- config.headers.Authorization = `Bearer ${token}`;
+ config.headers.Authorization = `Bearer ${token}`; // Must include 'Bearer ' prefix
12
}
13
return config;
14
0 commit comments