fix remove local

This commit is contained in:
efrilm 2025-09-17 18:43:14 +07:00
parent 2643963b49
commit 185edb94cb

View File

@ -30,9 +30,8 @@ api.interceptors.response.use(
response => response,
error => {
const status = error.response?.status
const currentPath = window.location.pathname
if (status === 401 && !currentPath.endsWith('/login')) {
if (status === 401) {
localStorage.removeItem('user')
localStorage.removeItem('authToken')
window.location.href = '/login'