5554-renovar_token #1566

Merged
vicent merged 24 commits from 5554-renovar_token into dev 2023-06-20 12:38:47 +00:00
1 changed files with 3 additions and 3 deletions
Showing only changes of commit ddd23a9842 - Show all commits

View File

@ -36,8 +36,8 @@ export class Layout extends Component {
this.$http.get('AccessTokenConfigs').then(json => {
const firtsResult = json.data[0];
if (!firtsResult) return;
window.localStorage.renewPeriod = firtsResult.renewPeriod;
window.localStorage.renewInterval = firtsResult.renewInterval;
this.renewPeriod = firtsResult.renewPeriod;
this.renewInterval = firtsResult.renewInterval;
vicent marked this conversation as resolved Outdated
Outdated
Review

No guardar renewPeriod y renewInterval en localStorage, guardarlos en this

No guardar `renewPeriod` y `renewInterval` en `localStorage`, guardarlos en `this`
const intervalMilliseconds = firtsResult.renewInterval * 1000;
this.inservalId = setInterval(this.checkTokenValidity.bind(this), intervalMilliseconds);
@ -49,7 +49,7 @@ export class Layout extends Component {
const differenceMilliseconds = now - new Date(this.vnToken.created);
const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
if (differenceSeconds > window.localStorage.renewPeriod) {
if (differenceSeconds > this.renewPeriod) {
this.$http.post('VnUsers/renewToken')
.then(json => {
if (json.data.token) {