| 1 |
import { Interaction } from "@web/public/interaction"; |
| 2 |
import { registry } from "@web/core/registry"; |
| 3 |
|
| 4 |
import { handleCheckIdentity } from "@portal/interactions/portal_security"; |
| 5 |
|
| 6 |
export class RevokeTrustedDevice extends Interaction { |
| 7 |
static selector = "#totp_wizard_view + * .fa.fa-trash.text-danger"; |
| 8 |
dynamicContent = { |
| 9 |
_root: { "t-on-click.prevent": this.onClick }, |
| 10 |
}; |
| 11 |
|
| 12 |
async onClick() { |
| 13 |
await this.waitFor(handleCheckIdentity( |
| 14 |
this.waitFor(this.services.orm.call("auth_totp.device", "remove", [parseInt(this.el.id)])), |
| 15 |
this.services.orm, |
| 16 |
this.services.dialog, |
| 17 |
)); |
| 18 |
location.reload(); |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
registry |
| 23 |
.category("public.interactions") |
| 24 |
.add("auth_totp_portal.revoke_trusted_device", RevokeTrustedDevice); |