diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2022-12-20 07:47:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-20 07:47:50 +0100 |
| commit | b0156792678b37563423c8fc0b10434a18a2a38a (patch) | |
| tree | 0ef05216ea5238910637f03fff891bf9664bd6a1 | |
| parent | 180d17c991d58757e6b96e66f7ff68aedd55b463 (diff) | |
| parent | 479d477e01039e95f4647e5b85f2bcd5ec560e81 (diff) | |
Merge pull request #8927 from nielsvanvelzen/auth-depr
| -rw-r--r-- | Jellyfin.Api/Controllers/UserController.cs | 10 | ||||
| -rw-r--r-- | Jellyfin.Api/Models/UserDtos/AuthenticateUserByName.cs | 10 |
2 files changed, 3 insertions, 17 deletions
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs index 002327d74..568224a42 100644 --- a/Jellyfin.Api/Controllers/UserController.cs +++ b/Jellyfin.Api/Controllers/UserController.cs @@ -157,7 +157,6 @@ namespace Jellyfin.Api.Controllers /// </summary> /// <param name="userId">The user id.</param> /// <param name="pw">The password as plain text.</param> - /// <param name="password">The password sha1-hash.</param> /// <response code="200">User authenticated.</response> /// <response code="403">Sha1-hashed password only is not allowed.</response> /// <response code="404">User not found.</response> @@ -166,10 +165,10 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status404NotFound)] + [Obsolete("Authenticate with username instead")] public async Task<ActionResult<AuthenticationResult>> AuthenticateUser( [FromRoute, Required] Guid userId, - [FromQuery, Required] string pw, - [FromQuery] string? password) + [FromQuery, Required] string pw) { var user = _userManager.GetUserById(userId); @@ -178,11 +177,6 @@ namespace Jellyfin.Api.Controllers return NotFound("User not found"); } - if (!string.IsNullOrEmpty(password) && string.IsNullOrEmpty(pw)) - { - return StatusCode(StatusCodes.Status403Forbidden, "Only sha1 password is not allowed."); - } - AuthenticateUserByName request = new AuthenticateUserByName { Username = user.Username, diff --git a/Jellyfin.Api/Models/UserDtos/AuthenticateUserByName.cs b/Jellyfin.Api/Models/UserDtos/AuthenticateUserByName.cs index 41f7b169e..31208264f 100644 --- a/Jellyfin.Api/Models/UserDtos/AuthenticateUserByName.cs +++ b/Jellyfin.Api/Models/UserDtos/AuthenticateUserByName.cs @@ -1,6 +1,4 @@ -using System; - -namespace Jellyfin.Api.Models.UserDtos +namespace Jellyfin.Api.Models.UserDtos { /// <summary> /// The authenticate user by name request body. @@ -16,11 +14,5 @@ namespace Jellyfin.Api.Models.UserDtos /// Gets or sets the plain text password. /// </summary> public string? Pw { get; set; } - - /// <summary> - /// Gets or sets the sha1-hashed password. - /// </summary> - [Obsolete("Send password using pw field")] - public string? Password { get; set; } } } |
