From 3c9c77bf595282cc0f9f0c7b857e118a4bce5fa5 Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Fri, 21 Sep 2018 13:59:24 +0300 Subject: [PATCH] Account layout fix. --- .../Pages/Account/Register.cshtml.cs | 10 +++------- .../Volo.Abp.Account.Web/Pages/Account/_Layout.cshtml | 8 ++++++++ .../Pages/Account/_ViewStart.cshtml | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/_Layout.cshtml diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs index 170a783197..67a1934eba 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Register.cshtml.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; +using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Account.Web.Settings; using Volo.Abp.Identity; @@ -36,13 +37,8 @@ namespace Volo.Abp.Account.Web.Pages.Account var user = new IdentityUser(GuidGenerator.Create(), Input.UserName, Input.EmailAddress, CurrentTenant.Id); - var result = await UserManager.CreateAsync(user, Input.Password); - - if (!result.Succeeded) - { - throw new NotImplementedException(); - } - + (await UserManager.CreateAsync(user, Input.Password)).CheckErrors(); + await UserManager.SetEmailAsync(user, Input.EmailAddress); await SignInManager.SignInAsync(user, isPersistent: false); diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_Layout.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_Layout.cshtml new file mode 100644 index 0000000000..a648fa61d1 --- /dev/null +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_Layout.cshtml @@ -0,0 +1,8 @@ +@using Volo.Abp.AspNetCore.Mvc.UI.Theming +@inject IThemeManager ThemeManager +@{ + Layout = ThemeManager.CurrentTheme.GetAccountLayout(); +} +
+ @RenderBody() +
\ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewStart.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewStart.cshtml index 54f5b26aaa..83295eda66 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewStart.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/_ViewStart.cshtml @@ -1,5 +1,5 @@ @using Volo.Abp.AspNetCore.Mvc.UI.Theming @inject IThemeManager ThemeManager @{ - Layout = ThemeManager.CurrentTheme.GetAccountLayout(); + Layout = "_Layout"; } \ No newline at end of file