From 19ec4921216dab8f3e19fec5a297601ba9fbaaa8 Mon Sep 17 00:00:00 2001 From: Lee Richardson Date: Thu, 23 Feb 2023 11:25:11 -0500 Subject: [PATCH 1/2] If local login disabled go to home page --- .../Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs index 1920cdd8ad..097c00c307 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs @@ -28,7 +28,13 @@ public class LogoutModel : AccountPageModel return RedirectSafely(ReturnUrl, ReturnUrlHash); } - return RedirectToPage("/Account/Login"); + var enableLocalLogin = await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin); + if (enableLocalLogin) + { + return RedirectToPage("/Account/Login"); + } + + return RedirectToPage("/"); } public virtual Task OnPostAsync() From ee3c2bcbf661b811f660b0d14284dd7a02176e9c Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 24 Feb 2023 10:32:43 +0800 Subject: [PATCH 2/2] Update Logout.cshtml.cs --- .../src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs index 097c00c307..ce1ecd0e82 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Logout.cshtml.cs @@ -1,6 +1,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Account.Settings; using Volo.Abp.Identity; +using Volo.Abp.Settings; namespace Volo.Abp.Account.Web.Pages.Account; @@ -28,8 +30,7 @@ public class LogoutModel : AccountPageModel return RedirectSafely(ReturnUrl, ReturnUrlHash); } - var enableLocalLogin = await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin); - if (enableLocalLogin) + if (await SettingProvider.IsTrueAsync(AccountSettingNames.EnableLocalLogin)) { return RedirectToPage("/Account/Login"); }