updated to throw errors

pull/9133/head
Galip Tolga Erdem 4 years ago
parent 5b11327b74
commit 6149193415

@ -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<AccountResource> L
@inject Volo.Abp.AspNetCore.Mvc.UI.Layout.IPageLayout PageLayout
@inject ISettingProvider SettingProvider
@{
PageLayout.Content.Title = L["LockedOut"].Value;
}
<abp-card>
<abp-card-body>
<abp-card-title>@L["AccountLockedOutTitle"]</abp-card-title>
<abp-card-text>@L["AccountLockedOutText"]</abp-card-text>
</abp-card-body>
</abp-card>

@ -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<IActionResult> OnGetAsync()
{
return Task.FromResult<IActionResult>(Page());
}
public virtual Task<IActionResult> OnPostAsync()
{
return Task.FromResult<IActionResult>(Page());
}
}
}

@ -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)

Loading…
Cancel
Save