The Free Software Media System - Server Backend & API
Fix variable declaration and follow sonarcloud suggestions
Davide Polonio57cf19f058a1
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.csindex 903d43faa6..6537a6a86a 100644--- a/Emby.Server.Implementations/Library/UserManager.cs+++ b/Emby.Server.Implementations/Library/UserManager.cs@@ -620,8 +620,9 @@ namespace Emby.Server.Implementations.Librarythrow new ArgumentNullException(nameof(user));}- bool hasConfiguredPassword = GetAuthenticationProvider(user).HasPassword(user);- bool hasConfiguredEasyPassword = !string.IsNullOrEmpty(GetAuthenticationProvider(user).GetEasyPasswordHash(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) &&diff --git a/MediaBrowser.Model/Dto/PublicUserDto.cs b/MediaBrowser.Model/Dto/PublicUserDto.csindex d5fd431eb6..d4eec8b9df 100644--- a/MediaBrowser.Model/Dto/PublicUserDto.cs+++ b/MediaBrowser.Model/Dto/PublicUserDto.cs@@ -1,6 +1,4 @@using System;-using MediaBrowser.Model.Configuration;-using MediaBrowser.Model.Users;namespace MediaBrowser.Model.Dto{@@ -29,9 +27,10 @@ namespace MediaBrowser.Model.Dto/// <summary>/// Gets or sets a value indicating whether this instance has configured password.+ /// Note that in this case this method should not be here, but it is necessary when changeing password at the+ /// first login./// </summary>/// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>- // FIXME this shouldn't be here, but it's necessary when changing password at the first loginpublic bool HasConfiguredPassword { get; set; }/// <summary>