aboutsummaryrefslogtreecommitdiff
path: root/src/static/scripts
diff options
context:
space:
mode:
authorJonathan Elias Caicedo <[email protected]>2023-02-24 16:24:48 -0500
committerJonathan Elias Caicedo <[email protected]>2023-02-24 16:24:48 -0500
commit8f8d7418eddaa180535d112f4db9da67fe8ac5b8 (patch)
treecfd08a6196e1cd05f6fc0ca07ea890b619a51be2 /src/static/scripts
parentaf6d17b7013d4d82fac916cb867c0dd97da9c301 (diff)
downloadvaultwarden-8f8d7418eddaa180535d112f4db9da67fe8ac5b8.tar.gz
vaultwarden-8f8d7418eddaa180535d112f4db9da67fe8ac5b8.zip
Add confirmation for removing 2FA and deauth sessions in admin panel
Diffstat (limited to 'src/static/scripts')
-rw-r--r--src/static/scripts/admin_users.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/static/scripts/admin_users.js b/src/static/scripts/admin_users.js
index b4da0f97..8f947d5d 100644
--- a/src/static/scripts/admin_users.js
+++ b/src/static/scripts/admin_users.js
@@ -32,10 +32,13 @@ function remove2fa(event) {
alert("Required parameters not found!");
return false;
}
- _post(`${BASE_URL}/admin/users/${id}/remove-2fa`,
- "2FA removed correctly",
- "Error removing 2FA"
- );
+ const confirmed = confirm(`Are you sure you want to remove 2FA for "${email}"?`);
+ if (confirmed) {
+ _post(`${BASE_URL}/admin/users/${id}/remove-2fa`,
+ "2FA removed correctly",
+ "Error removing 2FA"
+ );
+ }
}
function deauthUser(event) {
@@ -46,10 +49,13 @@ function deauthUser(event) {
alert("Required parameters not found!");
return false;
}
- _post(`${BASE_URL}/admin/users/${id}/deauth`,
- "Sessions deauthorized correctly",
- "Error deauthorizing sessions"
- );
+ const confirmed = confirm(`Are you sure you want to deauthorize sessions for "${email}"?`);
+ if (confirmed) {
+ _post(`${BASE_URL}/admin/users/${id}/deauth`,
+ "Sessions deauthorized correctly",
+ "Error deauthorizing sessions"
+ );
+ }
}
function disableUser(event) {