mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +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();
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ namespace Orchard.OpenId.Services {
|
|||||||
return _localAuthenticationUser;
|
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
|
//Get the local user, if local user account doesn't exist, create it
|
||||||
var localUser =
|
var localUser =
|
||||||
|
|||||||
Reference in New Issue
Block a user