Skip to content

Commit

Permalink
Fixing logout (removing shallow routing)
Browse files Browse the repository at this point in the history
  • Loading branch information
benzerbett committed Feb 22, 2024
1 parent edaba07 commit 736d9b3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pages/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ const Logout = props => {
window.sessionStorage.removeItem('user')
window.localStorage.removeItem('user')
window.document.cookie = 'access_token=; expires=Thu, 01 Jan 1970 00:00:00 GMT;'
router.push('/')

// router.push('/')
window.location.href = '/'
} else {
const cookieCutter = require('cookie-cutter')
cookieCutter.set('access_token', '', "{}", { expires: new Date(0), httpOnly: false })
}
} else {
if (typeof window !== 'undefined') {
router.push('/')
// router.push('/')
window.location.href = '/'
} else {
router.push('/')
}
Expand Down

0 comments on commit 736d9b3

Please sign in to comment.