Skip to content

Commit

Permalink
fix(sessions): Do not send close request without token
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Mar 6, 2023
1 parent 6f6df15 commit 25f86be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export function createSession(boardId) {
async close() {
clearInterval(interval)
document.removeEventListener('visibilitychange', visibilitychangeListener)
await sessionApi.closeSession(boardId, await tokenPromise)
if (token) {
await sessionApi.closeSession(boardId, token)
tokenPromise = null
token = null
delete axios.defaults.headers['x-nc-deck-session']
}
},
}
}

0 comments on commit 25f86be

Please sign in to comment.