mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-12-26 23:25:56 -05:00
Add confirmation for removing 2FA and deauth sessions in admin panel
This commit is contained in:
parent
af6d17b701
commit
8f8d7418ed
6
src/static/scripts/admin_users.js
vendored
6
src/static/scripts/admin_users.js
vendored
@ -32,11 +32,14 @@ function remove2fa(event) {
|
|||||||
alert("Required parameters not found!");
|
alert("Required parameters not found!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const confirmed = confirm(`Are you sure you want to remove 2FA for "${email}"?`);
|
||||||
|
if (confirmed) {
|
||||||
_post(`${BASE_URL}/admin/users/${id}/remove-2fa`,
|
_post(`${BASE_URL}/admin/users/${id}/remove-2fa`,
|
||||||
"2FA removed correctly",
|
"2FA removed correctly",
|
||||||
"Error removing 2FA"
|
"Error removing 2FA"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function deauthUser(event) {
|
function deauthUser(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -46,11 +49,14 @@ function deauthUser(event) {
|
|||||||
alert("Required parameters not found!");
|
alert("Required parameters not found!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const confirmed = confirm(`Are you sure you want to deauthorize sessions for "${email}"?`);
|
||||||
|
if (confirmed) {
|
||||||
_post(`${BASE_URL}/admin/users/${id}/deauth`,
|
_post(`${BASE_URL}/admin/users/${id}/deauth`,
|
||||||
"Sessions deauthorized correctly",
|
"Sessions deauthorized correctly",
|
||||||
"Error deauthorizing sessions"
|
"Error deauthorizing sessions"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function disableUser(event) {
|
function disableUser(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user