Skip to content

Commit

Permalink
Fix: remove unnecessary alert when auth codo is 401
Browse files Browse the repository at this point in the history
  • Loading branch information
WalkerWang731 committed Aug 14, 2024
1 parent 7f7bd9b commit bb4aca1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xinference/web/ui/src/components/authAlertDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ export default function AuthAlertDialog() {

const handleAuthStatus = () => {
const status = localStorage.getItem('authStatus')
if (status) {
setAuthStatus(status)
} else {
setAuthStatus('')
}
if (status === '401') {
removeCookie('token', { path: '/' })
localStorage.removeItem('authStatus')
sessionStorage.removeItem('token')
navigate('/login', { replace: true })
return
}
if (status) {
setAuthStatus(status)
} else {
setAuthStatus('')
}
}

Expand Down

0 comments on commit bb4aca1

Please sign in to comment.