mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-18 10:32:49 +00:00
Merge pull request #3187 from jellyfin/revert-2492-fix-api-private-data-leak
Revert "Fix emby/user/public API leaking sensitive data"
This commit is contained in:
@@ -608,31 +608,6 @@ namespace Emby.Server.Implementations.Library
|
||||
return dto;
|
||||
}
|
||||
|
||||
public PublicUserDto GetPublicUserDto(User user, string remoteEndPoint = null)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
IAuthenticationProvider authenticationProvider = GetAuthenticationProvider(user);
|
||||
bool hasConfiguredPassword = authenticationProvider.HasPassword(user);
|
||||
bool hasConfiguredEasyPassword = !string.IsNullOrEmpty(authenticationProvider.GetEasyPasswordHash(user));
|
||||
|
||||
bool hasPassword = user.Configuration.EnableLocalPassword &&
|
||||
!string.IsNullOrEmpty(remoteEndPoint) &&
|
||||
_networkManager.IsInLocalNetwork(remoteEndPoint) ? hasConfiguredEasyPassword : hasConfiguredPassword;
|
||||
|
||||
PublicUserDto dto = new PublicUserDto
|
||||
{
|
||||
Name = user.Name,
|
||||
HasPassword = hasPassword,
|
||||
HasConfiguredPassword = hasConfiguredPassword,
|
||||
};
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
public UserDto GetOfflineUserDto(User user)
|
||||
{
|
||||
var dto = GetUserDto(user);
|
||||
|
||||
Reference in New Issue
Block a user