#6264 - renewToken #1824

Merged
jsegarra merged 36 commits from 6264-renewToken into dev 2023-12-20 09:22:29 +00:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 784f5bb7f9 - Show all commits

View File

@ -3,7 +3,7 @@ const tokenConfig = require('./token-config');
module.exports = async token => {
jsegarra marked this conversation as resolved Outdated
Outdated
Review

Creo que se seria mas correcto usar vnNew()

Mas info: https://wiki.verdnatura.es/index.php/Fechas

Creo que se seria mas correcto usar vnNew() Mas info: https://wiki.verdnatura.es/index.php/Fechas

Okey, tomo nota.
Lo extraje de lo que hay actualmente de renew-token

Okey, tomo nota. Lo extraje de lo que hay actualmente de renew-token
const accessTokenConfig = await tokenConfig();
const now = new Date();
const now = Date.vnNew();
const differenceMilliseconds = now - token.created;
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
return differenceSeconds > accessTokenConfig.renewPeriod - accessTokenConfig.courtesyTime;