Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 27, 2025

The Blazor Web App template's ChangePassword.razor file contained a duplicate dependency injection line that was accidentally added. The file had both:

@inject RedirectManager RedirectManager
@inject IdentityRedirectManager RedirectManager

This created a conflict where both lines were trying to inject into the same RedirectManager property, but only IdentityRedirectManager is actually registered in the dependency injection container.

Before:

@inject UserManager<ApplicationUser> UserManager
@inject SignInManager<ApplicationUser> SignInManager
@inject RedirectManager RedirectManagerDuplicate/incorrect
@inject IdentityRedirectManager RedirectManagerCorrect
@inject ILogger<ChangePassword> Logger

After:

@inject UserManager<ApplicationUser> UserManager
@inject SignInManager<ApplicationUser> SignInManager
@inject IdentityRedirectManager RedirectManagerOnly correct line remains
@inject ILogger<ChangePassword> Logger

The fix removes the erroneous @inject RedirectManager RedirectManager line since:

  • No RedirectManager type exists in the codebase
  • Only IdentityRedirectManager is registered in DI (Program.cs)
  • Other template files consistently use @inject IdentityRedirectManager RedirectManager
  • All code references to RedirectManager continue to work unchanged

This is a minimal fix that resolves the template inconsistency while maintaining full functionality.

Fixes #63445.


✨ 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 Copilot AI changed the title [WIP] Blazor Web App template - bug in ChangePassword.razor Remove duplicate RedirectManager injection in Blazor Web App ChangePassword template Aug 27, 2025
Copilot finished work on behalf of ilonatommy August 27, 2025 09:35
@Copilot Copilot AI requested a review from ilonatommy August 27, 2025 09:35
@ilonatommy ilonatommy marked this pull request as ready for review August 27, 2025 09:38
@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 09:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes a duplicate dependency injection line in the Blazor Web App template's ChangePassword.razor file. The file had two conflicting @inject directives trying to inject into the same RedirectManager property, causing a template inconsistency.

  • Removes the incorrect @inject RedirectManager RedirectManager line
  • Keeps the correct @inject IdentityRedirectManager RedirectManager line that matches the registered DI service
  • Aligns the template with other files that consistently use IdentityRedirectManager

@ilonatommy ilonatommy added area-identity Includes: Identity and providers feature-templates labels Aug 27, 2025
@ilonatommy ilonatommy added this to the 10.0-rc2 milestone Aug 27, 2025
@ilonatommy ilonatommy requested a review from oroztocil August 27, 2025 10:01
@ilonatommy ilonatommy enabled auto-merge (squash) August 27, 2025 10:07
Copy link
Member

@oroztocil oroztocil left a comment

Choose a reason for hiding this comment

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

🚀

@javiercn
Copy link
Member

/backport to release/10.0

Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/aspnetcore/actions/runs/17271483739

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 Web App template - bug in ChangePassword.razor
4 participants