aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel GarcĂ­a <[email protected]>2023-02-28 23:42:47 +0100
committerGitHub <[email protected]>2023-02-28 23:42:47 +0100
commitda8225a3bdca659d061a696ffacac909791482dd (patch)
treecfd08a6196e1cd05f6fc0ca07ea890b619a51be2
parentaf6d17b7013d4d82fac916cb867c0dd97da9c301 (diff)
parent8f8d7418eddaa180535d112f4db9da67fe8ac5b8 (diff)
downloadvaultwarden-da8225a3bdca659d061a696ffacac909791482dd.tar.gz
vaultwarden-da8225a3bdca659d061a696ffacac909791482dd.zip
Merge pull request #3282 from JCBird1012/main
Add confirmation for removing 2FA and deauthing sessions in admin panel
-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) {