Compare commits
No commits in common. "fdcb0e12f4e9b3757c4812fa265ce3804aa8ba3d" and "7570e973b8d85dfa0e299ef99b5fdff8ac2f0126" have entirely different histories.
fdcb0e12f4
...
7570e973b8
@ -6,7 +6,8 @@ const getToken = () => {
|
||||
}
|
||||
|
||||
export const api = axios.create({
|
||||
baseURL: 'https://enaklo-pos-be.altru.id/api/v1',
|
||||
// baseURL: 'https://enaklo-pos-be.altru.id/api/v1',
|
||||
baseURL: 'http://127.0.0.1:4000/api/v1',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
@ -31,7 +32,7 @@ api.interceptors.response.use(
|
||||
error => {
|
||||
const status = error.response?.status
|
||||
|
||||
if (status === 401 && !currentPath.endsWith('/login')) {
|
||||
if (status === 401) {
|
||||
localStorage.removeItem('user')
|
||||
localStorage.removeItem('authToken')
|
||||
window.location.href = '/login'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user