Skip to content

Commit

Permalink
Fix logout bug (#696)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiveer authored Oct 3, 2024
1 parent 9f4b201 commit b2ef5bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/packs/useFetchApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const popupReloginDialog = () => {
.catch(() => {
window.location.href = "/logout"
})
.finally(() => {
clearCookies()
})
}

const useFetchApi = createFetch({
Expand Down Expand Up @@ -58,4 +61,11 @@ const useFetchApi = createFetch({
}
})

const clearCookies = () => {
cookies.keys().forEach((cookie) => {
cookies.remove(cookie)
})
window.location.href = '/'
}

export default useFetchApi

0 comments on commit b2ef5bf

Please sign in to comment.