adding posibility to disable user registration
Deploy / deploy (push) Successful in 1m43s

This commit is contained in:
2026-05-10 10:25:18 +02:00
parent 95a6973313
commit 1b95574b76
4 changed files with 68 additions and 2 deletions
+12 -1
View File
@@ -1033,6 +1033,13 @@ function esc(s) {
return div.innerHTML;
}
async function loadRegistrationSetting() {
try {
const res = await apiFetch('registration');
document.getElementById('registrationToggle').checked = res.registration_enabled === true;
} catch (e) {}
}
async function loadUsers() {
const list = document.getElementById('userList');
try {
@@ -1076,7 +1083,11 @@ async function removeUser(id) {
}
}
document.getElementById('settingsModal').addEventListener('show.bs.modal', loadUsers);
document.getElementById('settingsModal').addEventListener('show.bs.modal', () => {
loadUsers();
loadRegistrationSetting();
});
document.getElementById('registrationToggle').addEventListener('change', saveRegistrationSetting);
// ==================== DOCUMENTS ====================
const DOC_TYPE_ICONS = {
+10
View File
@@ -480,6 +480,16 @@
<button class="btn btn-primary" id="addUserBtn"><i class="fas fa-plus"></i> Add</button>
</div>
<small class="text-secondary">Get the user token from the user's Jakach Auth profile or ask them to log in once.</small>
<hr class="border-secondary">
<div class="d-flex justify-content-between align-items-center">
<div>
<h6 class="text-secondary mb-0"><i class="fas fa-user-plus me-1"></i> New User Registration</h6>
<small class="text-secondary">Allow new users to register via login link</small>
</div>
<div class="form-check form-switch mb-0">
<input class="form-check-input" type="checkbox" id="registrationToggle" style="cursor:pointer;">
</div>
</div>
</div>
</div>
</div>