added more fields (read only atm) for recorders

This commit is contained in:
2019-11-22 14:25:29 +01:00
parent 5792af21a5
commit c071591d82
5 changed files with 3563 additions and 3522 deletions

View File

@@ -87,6 +87,7 @@
return {
isLoading: false,
tokenValidity: -1,
refreshFailed: false,
refreshTokenValidity: -1,
showAlert: true,
alertMessage: 'NO MESSAGE PROVIDED',
@@ -112,15 +113,23 @@
EventBus.$on('failedLoadingRooms', (msg) => {
this.showErrorMessage(msg);
});
EventBus.$on('failedRefreshingToken', (msg)=>{
this.refreshFailed = true;
});
this.$nextTick(() => {
window.setInterval(() => {
// this.$log.debug(getRemainingJwtValiditySeconds(this.$store.state.access_token));
this.tokenValidity = getRemainingJwtValiditySeconds(this.$store.state.access_token);
this.refreshTokenValidity = getRemainingJwtValiditySeconds(this.$store.state.refresh_token);
// this.$log.debug(this.$store.state);
if (this.tokenValidity < 50 && this.refreshTokenValidity > 30) {
if (this.tokenValidity < 50 && this.refreshTokenValidity > 30 && !this.refreshFailed) {
this.$store.dispatch('refreshToken'); // renew access token
}
if(this.refreshFailed){
this.$store.dispatch('resetToken'); // delete all token info if refresh fails
this.$router.push({ name: 'login'});
this.refreshFailed = false;
}
}, 1000);
});