diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs index 09392e50b1..7ed98c0d78 100644 --- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLoginModel.cs @@ -139,12 +139,7 @@ namespace Volo.Abp.Account.Web.Pages.Account if (result.RequiresTwoFactor) { - return RedirectToPage("./SendSecurityCode", new - { - returnUrl = ReturnUrl, - returnUrlHash = ReturnUrlHash, - rememberMe = LoginInput.RememberMe - }); + return await TwoFactorLoginResultAsync(); } if (result.IsLockedOut) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs index ccd6e07a0f..b1dc1375cd 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs @@ -107,12 +107,7 @@ namespace Volo.Abp.Account.Web.Pages.Account if (result.RequiresTwoFactor) { - return RedirectToPage("./SendSecurityCode", new - { - returnUrl = ReturnUrl, - returnUrlHash = ReturnUrlHash, - rememberMe = LoginInput.RememberMe - }); + return await TwoFactorLoginResultAsync(); } if (result.IsLockedOut) @@ -142,6 +137,14 @@ namespace Volo.Abp.Account.Web.Pages.Account return RedirectSafely(ReturnUrl, ReturnUrlHash); } + /// + /// Override this method to add 2FA for your application. + /// + protected virtual Task TwoFactorLoginResultAsync() + { + throw new NotImplementedException(); + } + protected virtual async Task> GetExternalProviders() { var schemes = await SchemeProvider.GetAllSchemesAsync(); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml deleted file mode 100644 index 4bf575a761..0000000000 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@page -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.Account.Localization -@using Volo.Abp.Account.Web.Pages.Account -@model SendSecurityCodeModel -@inject IHtmlLocalizer L -

Send security code!

-

TODO: This page is under construction.

diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml.cs deleted file mode 100644 index 56f2e44b85..0000000000 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/SendSecurityCode.cshtml.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public class SendSecurityCodeModel : AccountPageModel - { - public List Providers { get; set; } - - public virtual async Task OnGetAsync() - { - var user = await SignInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return RedirectToPage("./Login"); - } - - return Page(); - - //CheckCurrentTenant(await SignInManager.GetVerifiedTenantIdAsync()); - - //Providers = (await UserManager.GetValidTwoFactorProvidersAsync(user)) - // .Select(userProvider => - // new SelectListItem - // { - // Text = userProvider, - // Value = userProvider - // }).ToList(); - - //return View( - // new SendSecurityCodeViewModel - // { - // ReturnUrl = returnUrl, - // RememberMe = rememberMe - // } - //); - } - - public virtual Task OnPostAsync() - { - return Task.FromResult(Page()); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs index ef0f583836..b34e918058 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs @@ -6,6 +6,7 @@ namespace Volo.CmsKit.Admin { [DependsOn( typeof(CmsKitAdminApplicationContractsModule), + typeof(AbpAutoMapperModule), typeof(CmsKitCommonApplicationModule) )] public class CmsKitAdminApplicationModule : AbpModule diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebAutoMapperProfile.cs deleted file mode 100644 index 5e1bc71477..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebAutoMapperProfile.cs +++ /dev/null @@ -1,14 +0,0 @@ -using AutoMapper; - -namespace Volo.CmsKit.Admin.Web -{ - public class CmsKitAdminWebAutoMapperProfile : Profile - { - public CmsKitAdminWebAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs index f8ae091733..075d700720 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.DependencyInjection; using Volo.CmsKit.Admin.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -44,13 +43,7 @@ namespace Volo.CmsKit.Admin.Web Configure(options => { - options.FileSets.AddEmbedded(); - }); - - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddMaps(validate: true); + options.FileSets.AddEmbedded("Volo.CmsKit.Admin.Web"); }); Configure(options => diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Volo.CmsKit.Admin.Web.csproj b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Volo.CmsKit.Admin.Web.csproj index 6895d6e0bd..3b548429c1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Volo.CmsKit.Admin.Web.csproj +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Volo.CmsKit.Admin.Web.csproj @@ -13,7 +13,6 @@ - diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs index 862213ab7a..0149722671 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/CmsKitPublicWebModule.cs @@ -44,7 +44,7 @@ namespace Volo.CmsKit.Public.Web Configure(options => { - options.FileSets.AddEmbedded(); + options.FileSets.AddEmbedded("Volo.CmsKit.Public.Web"); }); context.Services.AddAutoMapperObjectMapper(); diff --git a/npm/ng-packs/packages/schematics/package.json b/npm/ng-packs/packages/schematics/package.json index 10e2f5ba4c..11b774e0cc 100644 --- a/npm/ng-packs/packages/schematics/package.json +++ b/npm/ng-packs/packages/schematics/package.json @@ -1,13 +1,13 @@ { "name": "@abp/ng.schematics", - "version": "3.1.0-rc.1", - "description": "Schematics that works with ABP CLI", + "version": "3.0.5", + "description": "Schematics that works with ABP Backend", "keywords": [ "schematics" ], "author": "", "license": "MIT", - "schematics": "./src/collection.json", + "schematics": "./collection.json", "dependencies": { "@angular-devkit/core": "~10.0.3", "@angular-devkit/schematics": "~10.0.3",