mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 02:02:43 +00:00
UI/Remove spinner after token renew (#12887)
* fixes loading spinner * adds changelog
This commit is contained in:
3
changelog/12887.txt
Normal file
3
changelog/12887.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Remove spinner after token renew
|
||||
```
|
||||
@@ -40,8 +40,9 @@ export default class AuthInfoComponent extends Component {
|
||||
renewToken() {
|
||||
this.fakeRenew = true;
|
||||
run.later(() => {
|
||||
this.fakeRenew = false;
|
||||
this.auth.renew();
|
||||
this.auth.renew().then(() => {
|
||||
this.fakeRenew = this.auth.isRenewing;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ export default Service.extend({
|
||||
namespaceService: service('namespace'),
|
||||
IDLE_TIMEOUT: 3 * 60e3,
|
||||
expirationCalcTS: null,
|
||||
isRenewing: false,
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.checkForRootToken();
|
||||
@@ -249,14 +250,14 @@ export default Service.extend({
|
||||
if (currentlyRenewing) {
|
||||
return;
|
||||
}
|
||||
this.set('isRenewing', true);
|
||||
this.isRenewing = true;
|
||||
return this.renewCurrentToken().then(
|
||||
resp => {
|
||||
this.set('isRenewing', false);
|
||||
this.isRenewing = false;
|
||||
return this.persistAuthData(tokenName, resp.data || resp.auth);
|
||||
},
|
||||
e => {
|
||||
this.set('isRenewing', false);
|
||||
this.isRenewing = false;
|
||||
throw e;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{{#if (is-before (now interval=1000) this.auth.tokenExpirationDate)}}
|
||||
{{#if this.auth.authData.renewable}}
|
||||
<li class="action">
|
||||
<button type="button" {{action "renewToken"}} class="link button {{if this.isRenewing 'is-loading'}}">
|
||||
<button type="button" {{on "click" this.renewToken}} class="link button {{if this.isRenewing 'is-loading'}}">
|
||||
Renew token
|
||||
</button>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user