Skip to content

Add URL parameter auto-submit to login page - #50

Draft
jtenos with Copilot wants to merge 3 commits into
mainfrom
copilot/add-url-for-login-user
Draft

Add URL parameter auto-submit to login page#50
jtenos with Copilot wants to merge 3 commits into
mainfrom
copilot/add-url-for-login-user

Conversation

Copilot AI commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

Enables bookmarkable login URLs (e.g., /login/joe@whatever.com) that auto-submit the login request.

Changes

  • Login.razor: Added /login/{Email} route
  • Login.razor.cs:
    • Added [Parameter] Email property
    • Auto-submit logic in OnParametersSetAsync when email parameter present
    • Validates email format via DataAnnotations.Validator
    • Checks email against AllEmails list when populated (respects allowLoginDropdown config)
    • HasAutoSubmitted flag prevents duplicate submissions on re-render

Example

// URL: /login/joe@whatever.com
protected override async Task OnParametersSetAsync()
{
    // ... fetch AllEmails ...
    
    if (!string.IsNullOrWhiteSpace(Email) && !HasAutoSubmitted)
    {
        HasAutoSubmitted = true;
        Model.Email = Email;
        
        // Validate against AllEmails if populated
        if (AllEmails.Any() && !AllEmails.Contains(Email, StringComparer.OrdinalIgnoreCase))
        {
            await Swal.FireAsync("Error", "Email address not found in allowed users list", ...);
            return;
        }
        
        // Validate format and submit
        if (Validator.TryValidateObject(Model, ...)) { await HandleValidSubmit(); }
    }
}

Normal /login route behavior unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>URL for login user</issue_title>
<issue_description>/login/joe@whatever.com

Automatically submit the login request, so you can bookmark this url for faster login</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 22, 2025 17:53
Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
Co-authored-by: jtenos <607782+jtenos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automatic login URL submission for users Add URL parameter auto-submit to login page Nov 22, 2025
Copilot AI requested a review from jtenos November 22, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URL for login user

2 participants