mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-14 12:35:57 +03:00
support /users/<uuid>/invite/resend
admin api
This commit is contained in:
21
src/static/scripts/admin_users.js
vendored
21
src/static/scripts/admin_users.js
vendored
@@ -120,6 +120,24 @@ function inviteUser(event) {
|
||||
);
|
||||
}
|
||||
|
||||
function resendUserInvite (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const id = event.target.parentNode.dataset.vwUserUuid;
|
||||
const email = event.target.parentNode.dataset.vwUserEmail;
|
||||
if (!id) {
|
||||
alert("Required parameters not found!");
|
||||
return false;
|
||||
}
|
||||
const confirmed = confirm(`Are you sure you want to resend invitation for "${email}"?`);
|
||||
if (confirmed) {
|
||||
_post(`${BASE_URL}/admin/users/${id}/invite/resend`,
|
||||
"Invite sent successfully",
|
||||
"Error resend invite"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const ORG_TYPES = {
|
||||
"0": {
|
||||
"name": "Owner",
|
||||
@@ -228,6 +246,9 @@ function initUserTable() {
|
||||
document.querySelectorAll("button[vw-enable-user]").forEach(btn => {
|
||||
btn.addEventListener("click", enableUser);
|
||||
});
|
||||
document.querySelectorAll("button[vw-resend-user-invite]").forEach(btn => {
|
||||
btn.addEventListener("click", resendUserInvite);
|
||||
});
|
||||
|
||||
if (jdenticon) {
|
||||
jdenticon();
|
||||
|
@@ -72,6 +72,9 @@
|
||||
{{else}}
|
||||
<button type="button" class="btn btn-sm btn-link p-0 border-0 float-right" vw-enable-user>Enable User</button><br>
|
||||
{{/if}}
|
||||
{{#case _Status 1}}
|
||||
<button type="button" class="btn btn-sm btn-link p-0 border-0 float-right" vw-resend-user-invite>Resend invite</button><br>
|
||||
{{/case}}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user