Skip to content

Commit

Permalink
fix EasyOC.OpenId.ImplicitLogout
Browse files Browse the repository at this point in the history
fix EasyOC.OpenId.ImplicitLogout
  • Loading branch information
hyzx86 committed Feb 18, 2023
2 parents 0c75787 + c44c55b commit 4af2a40
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/Modules/EasyOC.ReplaceAction/ServiceExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc.Controllers;
using Castle.Core.Logging;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -75,6 +76,9 @@ public static IServiceProvider UseReplaceAction(this IServiceProvider servicePro
.OfType<ControllerActionDescriptor>()
.ToArray();

var logger = serviceProvider.GetService<ILogger>();


foreach (var descriptor in descriptors)
{
foreach (var item in config.Items.OrderBy(x => x.Order))
Expand All @@ -92,6 +96,15 @@ public static IServiceProvider UseReplaceAction(this IServiceProvider servicePro
{
descriptor.ControllerTypeInfo = item.NewController.GetTypeInfo();
descriptor.MethodInfo = item.ActionMapping[descriptor.ActionName];
if (logger != null && logger.IsDebugEnabled)
{
logger.DebugFormat("The Action:{action} of controller:{type} is replaced by {newContorller}.{method}",
item.TargetControllerFullName,
descriptor.ActionName,
descriptor.ControllerTypeInfo.FullName,
item.ActionMapping[descriptor.ActionName]
);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/EasyOC.Users/Manifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


[assembly: Feature(
Id = "EasyOC.OpenId",
Id = "EasyOC.OpenId.ImplicitLogout",
Name = "Implicit logout",
Dependencies = new[] { "OrchardCore.OpenId", "EasyOC.ReplaceAction" },
Description = "Confirmation is no longer required when logging out using OpenId",
Expand Down
3 changes: 2 additions & 1 deletion src/Modules/EasyOC.Users/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace EasyOC.Users
{
[Feature("EasyOC.Users")]
[RequireFeatures("OrchardCore.Users", "EasyOC.ReplaceAction")]
public class Startup : StartupBase
{
Expand All @@ -33,7 +34,7 @@ public override void ConfigureServices(IServiceCollection services)
}

}

[Feature("EasyOC.OpenId.ImplicitLogout")]
[RequireFeatures("OrchardCore.OpenId", "EasyOC.ReplaceAction")]
public class OpenIdStartup : StartupBase
{
Expand Down

0 comments on commit 4af2a40

Please sign in to comment.