forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.ts
More file actions
31 lines (26 loc) · 694 Bytes
/
Copy pathapi.ts
File metadata and controls
31 lines (26 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import axios from 'axios';
import { API_BASE } from '../services/api';
const apiClient = axios.create({
baseURL: API_BASE,
headers: {
'Content-Type': 'application/json',
},
});
// Add auth token interceptor
apiClient.interceptors.request.use((config) => {
const token = localStorage.getItem('txio_token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
// Password rotation API call
export const updatePassword = async (data: {
current_password: string;
new_password: string;
confirm_password: string;
}) => {
return apiClient.post('/auth/update-password', data);
};
// ... rest of the API functions
export { apiClient };