Login Logout Navbar ProfileForm moved to MUI
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import axios from 'axios';
|
||||
import store from '../store';
|
||||
import axios from "axios";
|
||||
import store from "../store";
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
baseURL: "/api",
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
api.interceptors.response.use(
|
||||
(res) => res,
|
||||
(err) => {
|
||||
if (err.response.status === 401) {
|
||||
store.dispatch({ type: 'auth/logOut' });
|
||||
store.dispatch({ type: "auth/logOut" });
|
||||
}
|
||||
return Promise.reject(err);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user