web/user: fix deletion of authenticator not refreshing page

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-06 19:09:29 +02:00
parent 88cc38394e
commit d55d44d664
4 changed files with 8 additions and 0 deletions

View file

@ -30,6 +30,8 @@ export class UserSettingsAuthenticatorDuo extends BaseUserSettings {
// TODO: Handle multiple devices, currently we assume only one TOTP Device
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsDuoDestroy({
id: devices.results[0].pk || 0
}).then(() => {
this.requestUpdate();
});
});
}}>

View file

@ -45,6 +45,8 @@ export class UserSettingsAuthenticatorStatic extends BaseUserSettings {
// TODO: Handle multiple devices, currently we assume only one TOTP Device
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsStaticDestroy({
id: devices.results[0].pk || 0
}).then(() => {
this.requestUpdate();
});
});
}}>

View file

@ -30,6 +30,8 @@ export class UserSettingsAuthenticatorTOTP extends BaseUserSettings {
// TODO: Handle multiple devices, currently we assume only one TOTP Device
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsTotpDestroy({
id: devices.results[0].pk || 0
}).then(() => {
this.requestUpdate();
});
});
}}>

View file

@ -31,6 +31,8 @@ export class UserSettingsAuthenticatorWebAuthn extends BaseUserSettings {
.delete=${() => {
return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsWebauthnDestroy({
id: device.pk || 0
}).then(() => {
this.requestUpdate();
});
}}>
<button slot="trigger" class="pf-c-button pf-m-danger">