diff --git a/src/Identity/Core/src/SignInManager.cs b/src/Identity/Core/src/SignInManager.cs index 4d139a408828..048f849c5a8a 100644 --- a/src/Identity/Core/src/SignInManager.cs +++ b/src/Identity/Core/src/SignInManager.cs @@ -165,10 +165,14 @@ public virtual async Task CanSignInAsync(TUser user) } /// - /// Signs in the specified , whilst preserving the existing + /// Refreshes the sign-in for the specified , whilst preserving the existing /// AuthenticationProperties of the current signed-in user like rememberMe, as an asynchronous operation. /// - /// The user to sign-in. + /// + /// The user must already be signed in, and the user ID must match the currently authenticated user. + /// If the user is not signed in, use instead. + /// + /// The user to refresh the sign-in for. /// The task object representing the asynchronous operation. public virtual async Task RefreshSignInAsync(TUser user) { @@ -204,8 +208,8 @@ public virtual async Task RefreshSignInAsync(TUser user) } IList claims = Array.Empty(); - var authenticationMethod = auth.Principal?.FindFirst(ClaimTypes.AuthenticationMethod); - var amr = auth.Principal?.FindFirst("amr"); + var authenticationMethod = auth.Principal.FindFirst(ClaimTypes.AuthenticationMethod); + var amr = auth.Principal.FindFirst("amr"); if (authenticationMethod != null || amr != null) { @@ -221,7 +225,7 @@ public virtual async Task RefreshSignInAsync(TUser user) } await SignInWithClaimsAsync(user, auth.Properties, claims); - return (true, auth.Properties?.IsPersistent ?? false); + return (true, auth.Properties.IsPersistent); } ///