fix: guest route

This commit is contained in:
ferdiansyah783
2025-08-14 00:29:19 +07:00
parent c01db516b1
commit 1cd8adc1e2
9 changed files with 32 additions and 34 deletions
+3 -2
View File
@@ -29,9 +29,9 @@ api.interceptors.response.use(
response => response,
error => {
const status = error.response?.status
const currentPath = window.location.pathname
if (status === 401) {
console.warn('Unauthorized. Redirecting to login...')
if (status === 401 && !currentPath.endsWith('/login')) {
window.location.href = '/login'
}
@@ -46,3 +46,4 @@ api.interceptors.response.use(
return Promise.reject(error)
}
)