From 9f7e6d9b4483ba9758cf79c7600856afe9546b17 Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 18 Jan 2021 15:35:32 +0800 Subject: [PATCH] Save when CurrentUser.IsAuthenticated --- .../Account/IdentityServerSupportedLogoutModel.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs index 0045353b49..94860e80c1 100644 --- a/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs +++ b/modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Account/IdentityServerSupportedLogoutModel.cs @@ -60,12 +60,15 @@ namespace Volo.Abp.Account.Web.Pages.Account protected virtual async Task SaveSecurityLogAsync(string clientId = null) { - await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() + if (CurrentUser.IsAuthenticated) { - Identity = IdentitySecurityLogIdentityConsts.Identity, - Action = IdentitySecurityLogActionConsts.Logout, - ClientId = clientId - }); + await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext() + { + Identity = IdentitySecurityLogIdentityConsts.Identity, + Action = IdentitySecurityLogActionConsts.Logout, + ClientId = clientId + }); + } } } }