mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 09:14:45 +03:00
Revert "Merge pull request #13604 from Jxiced/master"
This reverts commitce78af2ed4, reversing changes made todb7465e83d.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -132,16 +131,16 @@ public class StartupController : BaseJellyfinApiController
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<ActionResult> UpdateStartupUser([FromBody] StartupUserDto startupUserDto)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(startupUserDto.Name);
|
||||
_userManager.ThrowIfInvalidUsername(startupUserDto.Name);
|
||||
|
||||
var user = _userManager.Users.First();
|
||||
if (string.IsNullOrWhiteSpace(startupUserDto.Password))
|
||||
{
|
||||
return BadRequest("Password must not be empty");
|
||||
}
|
||||
|
||||
user.Username = startupUserDto.Name;
|
||||
if (startupUserDto.Name is not null)
|
||||
{
|
||||
user.Username = startupUserDto.Name;
|
||||
}
|
||||
|
||||
await _userManager.UpdateUserAsync(user).ConfigureAwait(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user