Update AspNetUser.cs

This commit is contained in:
anjoy8 2020-09-08 18:14:52 +08:00
parent 8ed7077075
commit a27b04f121

View File

@ -22,7 +22,7 @@ namespace Blog.Core.Common.HttpContextUser
private string GetName()
{
if (IsAuthenticated())
if (IsAuthenticated() && _accessor.HttpContext.User.Identity.Name.IsNotEmptyOrNull())
{
return _accessor.HttpContext.User.Identity.Name;
}