From dd59ef17f521aceed57219d5bb6537ce66b08789 Mon Sep 17 00:00:00 2001 From: Russell Date: Wed, 31 May 2023 22:46:02 +1200 Subject: [PATCH] Fix for User null from IP address "::1" has logged out (#14322) --- .../Controllers/AuthenticationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs index 97aa5bd118..d3a47157c0 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs @@ -633,7 +633,7 @@ public class AuthenticationController : UmbracoApiControllerBase await _signInManager.SignOutAsync(); _logger.LogInformation("User {UserName} from IP address {RemoteIpAddress} has logged out", - User.Identity == null ? "UNKNOWN" : User.Identity.Name, HttpContext.Connection.RemoteIpAddress); + result.Principal.Identity == null ? "UNKNOWN" : result.Principal.Identity.Name, HttpContext.Connection.RemoteIpAddress); var userId = result.Principal.Identity?.GetUserId(); SignOutSuccessResult args = _userManager.NotifyLogoutSuccess(User, userId);