Add logic to prefill email if it exist

This commit is contained in:
2025-08-05 20:39:43 +10:00
parent 94cd6e680c
commit d0de0c420c
+22
View File
@@ -274,6 +274,25 @@
return redirectParam || rdParam;
}
// Extract email parameter from URL
function getEmailFromUrl() {
const urlParams = new URLSearchParams(window.location.search);
const emailParam = urlParams.get('email');
return emailParam;
}
// Pre-fill email input if email parameter exists
function prefillEmail() {
const email = getEmailFromUrl();
if (email) {
const emailInput = document.getElementById('email');
if (emailInput) {
emailInput.value = decodeURIComponent(email);
}
}
}
function redirectAfterAuth() {
const redirectUrl = getRedirectUrl();
console.log('Checking for redirect URL:', redirectUrl);
@@ -895,6 +914,9 @@
// Load theme first
loadTheme();
// Pre-fill email if provided in URL parameters
prefillEmail();
// Check if there's a redirect URL and update header
const redirectUrl = getRedirectUrl();
if (redirectUrl) {