diff --git a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs index 10a9553113..7e414f93be 100644 --- a/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs +++ b/src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs @@ -61,7 +61,6 @@ namespace AbpDesk.Web.Mvc services.PreConfigure(builder => { builder - .AddViewLocalization() //TODO: Move to the framework! .AddRazorPagesOptions(options => { options.Conventions.AuthorizeFolder("/App"); diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs new file mode 100644 index 0000000000..91e40e5254 --- /dev/null +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/Controllers/AccountController.cs @@ -0,0 +1,16 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Identity; +using Volo.Abp.AspNetCore.Mvc; + +namespace MicroserviceDemo.Web.Controllers +{ + public class AccountController : AbpController + { + public async Task Logout() + { + await HttpContext.SignOutAsync(IdentityConstants.ApplicationScheme); + await HttpContext.SignOutAsync("oidc"); + } + } +} diff --git a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs index a65d889bad..1eb5987748 100644 --- a/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs +++ b/src/MicroserviceDemo/MicroserviceDemo.Web/MicroservicesDemoWebModule.cs @@ -36,14 +36,6 @@ namespace MicroserviceDemo.Web [DependsOn(typeof(AbpAspNetCoreAuthenticationOAuthModule))] public class MicroservicesDemoWebModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(builder => - { - builder.AddViewLocalization(); //TODO: To the framework! - }); - } - public override void ConfigureServices(IServiceCollection services) { var hostingEnvironment = services.GetSingletonInstance(); diff --git a/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs b/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs index 0bcd072008..a5fec0f255 100644 --- a/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs +++ b/src/Volo.Abp.AspNetCore.Authentication.OAuth/Microsoft/AspNetCore/Authentication/OAuth/Claims/AbpClaimActionCollectionExtensions.cs @@ -12,6 +12,8 @@ namespace Microsoft.AspNetCore.Authentication.OAuth.Claims claimActions.MapJsonKey(AbpClaimTypes.EmailVerified, "email_verified"); claimActions.MapJsonKey(AbpClaimTypes.PhoneNumber, "phone_number"); claimActions.MapJsonKey(AbpClaimTypes.PhoneNumberVerified, "phone_number_verified"); + claimActions.DeleteClaim("name"); + claimActions.DeleteClaim("email"); } } } diff --git a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs index 8bb95c8817..aa4e373691 100644 --- a/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs +++ b/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcModule.cs @@ -81,7 +81,8 @@ namespace Volo.Abp.AspNetCore.Mvc var resourceType = assemblyResources.GetOrDefault(type.Assembly); return factory.Create(resourceType ?? type); }; - }); + }) + .AddViewLocalization(); //TODO: How to configure from the application? Also, consider to move to a UI module since APIs does not care about it. services.ExecutePreConfiguredActions(mvcBuilder); diff --git a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs index 7763a85355..9b284263bf 100644 --- a/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs +++ b/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/AbpAspNetCoreMvcTestModule.cs @@ -20,14 +20,6 @@ namespace Volo.Abp.AspNetCore.Mvc )] public class AbpAspNetCoreMvcTestModule : AbpModule { - public override void PreConfigureServices(IServiceCollection services) - { - services.PreConfigure(builder => - { - builder.AddViewLocalization(); - }); - } - public override void ConfigureServices(IServiceCollection services) { services.AddLocalization(); //TODO: Move to the framework..?