From 76b09d5d4733cf8d102cca0edfacabfee686e7ff Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Mon, 24 May 2021 11:50:14 +0300 Subject: [PATCH] updated to return confirm page when user is not allowed --- .../Volo/Abp/Account/Localization/Resources/en.json | 1 - .../Pages/Account/LockedOut.cshtml | 12 ------------ .../Pages/Account/Login.cshtml.cs | 6 +++++- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json index 0884e04984..5817e558ee 100644 --- a/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json +++ b/modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/Localization/Resources/en.json @@ -64,7 +64,6 @@ "AccessDenied": "Access denied!", "AccessDeniedMessage": "You do not have access to this resource.", "LockedOut": "Locked Out", - "AccountDisabledTitle": "Your account is not enabled!", "AccountLockedOutTitle": "Your account is locked!", "AccountLockedOutText": "Please contact to admin." } 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 index 2fc1083c5b..5fdd5ebbcb 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/LockedOut.cshtml @@ -2,29 +2,17 @@ @model Volo.Abp.Account.Web.Pages.Account.LockedOut @using Volo.Abp.Account.Localization @using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.Identity.Settings @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; - var requireConfirmedEmail = await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedEmail); - var requireConfirmedPhoneNumber = await SettingProvider.IsTrueAsync(IdentitySettingNames.SignIn.RequireConfirmedPhoneNumber); - bool isAccountDisabled = requireConfirmedEmail || requireConfirmedPhoneNumber; } - @if (isAccountDisabled) - { - @L["AccountDisabledTitle"] - @L["LoginIsNotAllowed"] - } - else - { @L["AccountLockedOutTitle"] @L["AccountLockedOutText"] - } \ 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 26881d9e5f..f43d837252 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 @@ -220,7 +220,11 @@ namespace Volo.Abp.Account.Web.Pages.Account if (result.IsNotAllowed) { Logger.LogWarning($"External login callback error: User is Not Allowed!"); - return RedirectToPage("./LockedOut"); + return RedirectToPage("./ConfirmUser", new + { + returnUrl = ReturnUrl, + returnUrlHash = ReturnUrlHash + }); } if (result.Succeeded)