Fix logging the user out when renewing the token while the api is not reachable

This commit is contained in:
kolaente 2020-12-24 01:43:52 +01:00
parent 7c656d4708
commit 2c273a7fd9
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -186,7 +186,12 @@ export default {
.catch(e => {
// eslint-disable-next-line
console.log('Error renewing token: ', e)
ctx.dispatch('logout')
// Don't logout on network errors as the user would then get logged out if they don't have
// internet for a short period of time - such as when the laptop is still reconnecting
if (e.request.status) {
ctx.dispatch('logout')
}
})
},
logout(ctx) {