Skip to content

Remove invalid asp-route-returnUrl attribute from Blazor Register template #62443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 23, 2025

The Blazor Register page template contained an invalid asp-route-returnUrl="@ReturnUrl" attribute on the EditForm element. Tag helpers like asp-route-* do not work in Blazor components and this was a copy/paste error from the Razor Pages implementation.

Change Made

- <EditForm Model="Input" asp-route-returnUrl="@ReturnUrl" method="post" OnValidSubmit="RegisterUser" FormName="register">
+ <EditForm Model="Input" method="post" OnValidSubmit="RegisterUser" FormName="register">

Why This Fix is Correct

The ReturnUrl functionality remains completely intact through the proper Blazor mechanisms:

  • Parameter capture: [SupplyParameterFromQuery] private string? ReturnUrl { get; set; } properly captures the returnUrl query parameter
  • Usage in redirects: ReturnUrl is correctly used in the registration flow:
    • Passed to email confirmation callback URL
    • Passed to RegisterConfirmation page when email confirmation is required
    • Used for direct redirect when no email confirmation is needed

The removed asp-route-returnUrl attribute was non-functional in Blazor components, so removing it has no impact on the actual functionality while cleaning up invalid syntax.

This is a minimal, surgical change affecting only the problematic line.

Fixes #62352.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Blazor Register page template contains asp-route-returnUrl="@ReturnUrl" Remove invalid asp-route-returnUrl attribute from Blazor Register template Jun 23, 2025
@Copilot Copilot AI requested a review from MackinnonBuck June 23, 2025 16:46
Copilot finished work on behalf of MackinnonBuck June 23, 2025 16:46
@MackinnonBuck MackinnonBuck marked this pull request as ready for review June 24, 2025 20:20
Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Assuming the test failures are unrelated?

@MackinnonBuck
Copy link
Member

LGTM. Assuming the test failures are unrelated?

Yes, test failures don't appear related.

@MackinnonBuck MackinnonBuck enabled auto-merge (squash) June 24, 2025 20:47
@MackinnonBuck MackinnonBuck merged commit f2353d2 into main Jun 24, 2025
27 checks passed
@MackinnonBuck MackinnonBuck deleted the copilot/fix-62352 branch June 24, 2025 21:16
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview7 milestone Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor Register page template contains asp-route-returnUrl="@ReturnUrl"
3 participants