1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-25 04:22:49 +00:00

Allow removing users two factors

This commit is contained in:
Daniel García 2019-08-21 17:13:06 +02:00
parent d23d4f2c1d
commit 026f9da035
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
3 changed files with 27 additions and 6 deletions

View file

@ -26,9 +26,13 @@
{{/each}}
</span>
</div>
<div style="flex: 0 0 240px;">
<a class="mr-3" href="#" onclick='deauthUser({{jsesc Id}})'>Deauthorize sessions</a>
<a class="mr-3" href="#" onclick='deleteUser({{jsesc Id}}, {{jsesc Email}})'>Delete User</a>
<div style="flex: 0 0 300px; font-size: 90%; text-align: right; padding-right: 15px">
{{#if TwoFactorEnabled}}
<a class="mr-2" href="#" onclick='remove2fa({{jsesc Id}})'>Remove all 2FA</a>
{{/if}}
<a class="mr-2" href="#" onclick='deauthUser({{jsesc Id}})'>Deauthorize sessions</a>
<a class="mr-2" href="#" onclick='deleteUser({{jsesc Id}}, {{jsesc Email}})'>Delete User</a>
</div>
</div>
</div>
@ -227,6 +231,12 @@
}
return false;
}
function remove2fa(id) {
_post("/admin/users/" + id + "/remove-2fa",
"2FA removed correctly",
"Error removing 2FA");
return false;
}
function deauthUser(id) {
_post("/admin/users/" + id + "/deauth",
"Sessions deauthorized correctly",