fix registration

This commit is contained in:
Thanakorn S
2026-05-13 16:15:19 +07:00
parent 511360faa2
commit 4433ef184e
3 changed files with 53 additions and 18 deletions
+27 -2
View File
@@ -117,6 +117,21 @@
<p class="text-muted small mb-0">We've sent a verification link to your email address. Click it to activate your account.</p>
</div>
<!-- Fallback: email failed, show verify link directly -->
<div id="verify_link_panel" class="d-none py-3">
<div class="alert alert-warning small mb-3">
<i class="ti ti-alert-triangle me-1"></i>
Account created, but the verification email could not be sent (server email is not configured).
Use the link below to verify your account:
</div>
<div class="input-group">
<input type="text" class="form-control form-control-sm font-monospace" id="verify_link_input" readonly>
<button class="btn btn-sm btn-outline-secondary" onclick="copy_verify_link()">
<i class="ti ti-copy"></i>
</button>
</div>
</div>
<p class="text-center text-muted small mb-0">
Already have an account?
<a href="<?php echo $server_url?>login/index.php" class="link-primary">Sign in</a>
@@ -237,12 +252,22 @@
confirm_password: confirm,
})},
onSuccess: function (r) {
// Hide form, show success panel
$('input, button, .row, .mb-3, .mb-4').hide();
$('#success_panel').removeClass('d-none');
if (r.verify_url) {
$('#verify_link_input').val(r.verify_url);
$('#verify_link_panel').removeClass('d-none');
} else {
$('#success_panel').removeClass('d-none');
}
},
});
}
function copy_verify_link() {
const val = $('#verify_link_input').val();
navigator.clipboard.writeText(val).then(function () {
bootbox.alert('Verification link copied to clipboard.');
});
}
</script>
</body>