From 000a4e0054d4a39ddeea1c4082c550957d1cd698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Y=C3=BBki=20Vachot?= Date: Fri, 10 Dec 2021 18:21:30 +0100 Subject: [PATCH] Update: Prettify token expiration dates --- app-backend/config/sessionJWT.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app-backend/config/sessionJWT.config.js b/app-backend/config/sessionJWT.config.js index 30a959e..da5bdb7 100644 --- a/app-backend/config/sessionJWT.config.js +++ b/app-backend/config/sessionJWT.config.js @@ -82,6 +82,9 @@ function checkLogin(req, res, role=null){ if(typeof token.email === 'undefined' || typeof token.email === 'undefined'){ return sendError(res, 500, 102, "User not authenticated."); } else { + token.midExp = new Date(token.midExp*1000); + token.iat = new Date(token.iat*1000); + token.exp = new Date(token.exp*1000); if(role === null){ return token; } else {