Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit d0de0c4

Browse files
committed
Add logic to prefill email if it exist
1 parent 94cd6e6 commit d0de0c4

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

web/login.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,25 @@ <h3>User Management</h3>
274274
return redirectParam || rdParam;
275275
}
276276

277+
// Extract email parameter from URL
278+
function getEmailFromUrl() {
279+
const urlParams = new URLSearchParams(window.location.search);
280+
const emailParam = urlParams.get('email');
281+
282+
return emailParam;
283+
}
284+
285+
// Pre-fill email input if email parameter exists
286+
function prefillEmail() {
287+
const email = getEmailFromUrl();
288+
if (email) {
289+
const emailInput = document.getElementById('email');
290+
if (emailInput) {
291+
emailInput.value = decodeURIComponent(email);
292+
}
293+
}
294+
}
295+
277296
function redirectAfterAuth() {
278297
const redirectUrl = getRedirectUrl();
279298
console.log('Checking for redirect URL:', redirectUrl);
@@ -895,6 +914,9 @@ <h4>${user.display_name}</h4>
895914
// Load theme first
896915
loadTheme();
897916

917+
// Pre-fill email if provided in URL parameters
918+
prefillEmail();
919+
898920
// Check if there's a redirect URL and update header
899921
const redirectUrl = getRedirectUrl();
900922
if (redirectUrl) {

0 commit comments

Comments
 (0)