diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/TwoFactorAuthenticationController.cs b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/TwoFactorAuthenticationController.cs index 739effb3758..a1c62245cde 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/Controllers/TwoFactorAuthenticationController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/Controllers/TwoFactorAuthenticationController.cs @@ -16,7 +16,6 @@ using OrchardCore.DisplayManagement.Notify; using OrchardCore.Entities; using OrchardCore.Modules; -using OrchardCore.Mvc.Core.Utilities; using OrchardCore.Settings; using OrchardCore.Users.Events; using OrchardCore.Users.Models; @@ -28,8 +27,6 @@ namespace OrchardCore.Users.Controllers; [Feature(UserConstants.Features.TwoFactorAuthentication)] public class TwoFactorAuthenticationController : TwoFactorAuthenticationBaseController, IUpdateModel { - public static readonly string ControllerName = typeof(TwoFactorAuthenticationController).ControllerName(); - private readonly ILogger _logger; private readonly IEnumerable _accountEvents; private readonly IdentityOptions _identityOptions; diff --git a/src/OrchardCore.Modules/OrchardCore.Users/TwoFactorAuthenticationStartup.cs b/src/OrchardCore.Modules/OrchardCore.Users/TwoFactorAuthenticationStartup.cs index b5dabf97c24..2e42c6310a4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/TwoFactorAuthenticationStartup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Users/TwoFactorAuthenticationStartup.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Options; using OrchardCore.DisplayManagement.Handlers; using OrchardCore.Modules; +using OrchardCore.Mvc.Core.Utilities; using OrchardCore.Settings; using OrchardCore.Users.Controllers; using OrchardCore.Users.Drivers; @@ -22,7 +23,7 @@ namespace OrchardCore.Users; [Feature(UserConstants.Features.TwoFactorAuthentication)] public class TwoFactorAuthenticationStartup : StartupBase { - private UserOptions _userOptions; + private static readonly string _twoFactorControllerName = typeof(TwoFactorAuthenticationController).ControllerName(); private UserOptions _userOptions; public override void ConfigureServices(IServiceCollection services) { @@ -47,7 +48,7 @@ public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder ro pattern: "LoginWithTwoFactorAuthentication", defaults: new { - controller = TwoFactorAuthenticationController.ControllerName, + controller = _twoFactorControllerName, action = nameof(TwoFactorAuthenticationController.LoginWithTwoFactorAuthentication), } ); @@ -58,7 +59,7 @@ public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder ro pattern: _userOptions.TwoFactorAuthenticationPath, defaults: new { - controller = TwoFactorAuthenticationController.ControllerName, + controller = _twoFactorControllerName, action = nameof(TwoFactorAuthenticationController.Index), } );