Add copy invite link button and auto-populate invite code from URL

Admin panel gets "Copy Link" button on active invites that copies
a signup URL with ?invite= param. Client auto-opens signup form
with invite code pre-filled when visiting that link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-02-21 23:54:06 -05:00
parent 538ca51ba5
commit 797d1e0280
2 changed files with 26 additions and 2 deletions

View File

@@ -4672,8 +4672,9 @@ class AuthManager {
this.forgotForm?.addEventListener('submit', (e) => this.handleForgotPassword(e));
this.resetForm?.addEventListener('submit', (e) => this.handleResetPassword(e));
// Check URL for reset token on page load
// Check URL for reset token or invite code on page load
this.checkResetToken();
this.checkInviteCode();
}
showModal(form = 'login') {
@@ -4826,6 +4827,18 @@ class AuthManager {
}
}
checkInviteCode() {
const params = new URLSearchParams(window.location.search);
const invite = params.get('invite');
if (invite) {
this.signupInviteCode.value = invite;
this.showModal('signup');
// Clean URL
window.history.replaceState({}, '', '/');
}
}
async handleForgotPassword(e) {
e.preventDefault();
this.clearErrors();