mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 20:16:15 +08:00
Fixing that OpenIdAuthenticationService.GetAuthenticatedUser should check the user's name
This commit is contained in:
@@ -80,9 +80,9 @@ namespace Orchard.OpenId.Services {
|
||||
return FallbackAuthenticationService.GetAuthenticatedUser();
|
||||
}
|
||||
|
||||
var user = _httpContextAccessor.Current().GetOwinContext().Authentication.User;
|
||||
var userIdentity = _httpContextAccessor.Current().GetOwinContext().Authentication.User.Identity;
|
||||
|
||||
if (!user.Identity.IsAuthenticated) {
|
||||
if (string.IsNullOrEmpty(userIdentity.Name?.Trim()) || !userIdentity.IsAuthenticated) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Orchard.OpenId.Services {
|
||||
return _localAuthenticationUser;
|
||||
}
|
||||
|
||||
var userName = user.Identity.Name.Trim();
|
||||
var userName = userIdentity.Name.Trim();
|
||||
|
||||
//Get the local user, if local user account doesn't exist, create it
|
||||
var localUser =
|
||||
|
||||
Reference in New Issue
Block a user