From 1ee8efc90e26d327daa00fd6a2acf9e7c4c03155 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 7 Apr 2021 16:35:14 +0200 Subject: [PATCH] Fix logout test --- src/components/home/contentAuth.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue index d9a784cea..ce4b2fd1d 100644 --- a/src/components/home/contentAuth.vue +++ b/src/components/home/contentAuth.vue @@ -88,7 +88,7 @@ export default { // Check if the token is still valid if the window gets focus again to maybe renew it window.addEventListener('focus', () => { - const expiresIn = this.userInfo.exp - +new Date() / 1000 + const expiresIn = (this.userInfo !== null ? this.userInfo.exp : 0) - +new Date() / 1000 // If the token expiry is negative, it is already expired and we have no choice but to redirect // the user to the login page