Skip to content

Commit

Permalink
Merge pull request #747 from akto-api-security/fix/saas_login
Browse files Browse the repository at this point in the history
Fixed logout issue
  • Loading branch information
aktoboy authored Nov 30, 2023
2 parents 2fadb9b + d0c2b41 commit a9dbe96
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ export default function Header() {

const handleLogOut = async () => {
storeAccessToken(null)
await api.logout()
navigate("/login")
api.logout().then(res => {
if(res.logoutUrl){
window.location.href = res.logoutUrl
} else {
navigate("/login")
}
}).catch(err => {
navigate("/");
})
}

const handleSwitchUI = async () => {
Expand Down

0 comments on commit a9dbe96

Please sign in to comment.