From 6149193415ac8f579e27ebbe38df9a6deb9a0ae1 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 24 May 2021 11:59:39 +0300 Subject: [PATCH] updated to throw errors --- .../Pages/Account/LockedOut.cshtml | 18 ------------------ .../Pages/Account/LockedOut.cshtml.cs | 18 ------------------ .../Pages/Account/Login.cshtml.cs | 12 ++++-------- 3 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml delete mode 100644 modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml.cs diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml deleted file mode 100644 index 5fdd5ebbcb..0000000000 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml +++ /dev/null @@ -1,18 +0,0 @@ -@page "/Account/LockedOut" -@model Volo.Abp.Account.Web.Pages.Account.LockedOut -@using Volo.Abp.Account.Localization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.Settings -@inject IHtmlLocalizer L -@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout -@inject ISettingProvider SettingProvider -@{ - PageLayout.Content.Title = L["LockedOut"].Value; - -} - - - @L["AccountLockedOutTitle"] - @L["AccountLockedOutText"] - - \ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml.cs deleted file mode 100644 index 90eb091d64..0000000000 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace Volo.Abp.Account.Web.Pages.Account -{ - public class LockedOut : AccountPageModel - { - public virtual Task OnGetAsync() - { - return Task.FromResult(Page()); - } - - public virtual Task OnPostAsync() - { - return Task.FromResult(Page()); - } - } -} \ No newline at end of file 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 f43d837252..313f3f07c0 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 @@ -213,18 +213,14 @@ namespace Volo.Abp.Account.Web.Pages.Account if (result.IsLockedOut) { - Logger.LogWarning($"Cannot proceed because user is locked out!"); - return RedirectToPage("./LockedOut"); + Logger.LogWarning($"External login callback error: user is locked out!"); + throw new UserFriendlyException("Cannot proceed because user is locked out!"); } if (result.IsNotAllowed) { - Logger.LogWarning($"External login callback error: User is Not Allowed!"); - return RedirectToPage("./ConfirmUser", new - { - returnUrl = ReturnUrl, - returnUrlHash = ReturnUrlHash - }); + Logger.LogWarning($"External login callback error: user is not allowed!"); + throw new UserFriendlyException("Cannot proceed because user is not allowed!"); } if (result.Succeeded)