From 46ffd8d95af931bd0d5d2e42bacaaad192db4a25 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 27 Jun 2023 08:07:54 +0200 Subject: [PATCH] refs #5554 console.log --- back/methods/vn-user/renew-token.js | 2 ++ front/salix/components/layout/index.js | 1 + 2 files changed, 3 insertions(+) diff --git a/back/methods/vn-user/renew-token.js b/back/methods/vn-user/renew-token.js index 41470dfea..fb99992bf 100644 --- a/back/methods/vn-user/renew-token.js +++ b/back/methods/vn-user/renew-token.js @@ -27,6 +27,8 @@ module.exports = Self => { const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']}); + console.log(userId, created, now, differenceMilliseconds, differenceSeconds, accessTokenConfig.renewPeriod, differenceSeconds <= accessTokenConfig.renewPeriod); + if (differenceSeconds <= accessTokenConfig.renewPeriod) throw new UserError(`The renew period has not been exceeded`); diff --git a/front/salix/components/layout/index.js b/front/salix/components/layout/index.js index dc2313f4f..008d31ab2 100644 --- a/front/salix/components/layout/index.js +++ b/front/salix/components/layout/index.js @@ -49,6 +49,7 @@ export class Layout extends Component { const differenceMilliseconds = now - new Date(this.vnToken.created); const differenceSeconds = Math.floor(differenceMilliseconds / 1000); + console.log(this.vnToken.created, now, differenceMilliseconds, differenceSeconds, this.renewPeriod, differenceSeconds > this.renewPeriod); if (differenceSeconds > this.renewPeriod) { this.$http.post('VnUsers/renewToken') .then(json => {