added profile and token refresh
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<section class="hero is-primary">
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
<h2 class="title">Profile</h2>
|
||||
<h2 class="title">Profile ({{tokenValidity}})</h2>
|
||||
<p>{{profile.id}}</p>
|
||||
<p class="subtitle error-msg">{{ errorMsg }}</p>
|
||||
</div>
|
||||
@@ -16,12 +16,14 @@
|
||||
|
||||
<script>
|
||||
import { EventBus } from '@/utils'
|
||||
import {getRemainingJwtValiditySeconds} from "../utils";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
email: '',
|
||||
errorMsg: '',
|
||||
tokenValidity: -1,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -37,6 +39,13 @@
|
||||
});
|
||||
this.$store.dispatch('loadProfile');
|
||||
|
||||
this.$nextTick(() =>{
|
||||
window.setInterval(() => {
|
||||
this.$log.debug(getRemainingJwtValiditySeconds(this.$store.state.access_token));
|
||||
this.tokenValidity = getRemainingJwtValiditySeconds(this.$store.state.access_token);
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
||||
Reference in New Issue
Block a user