danylokhodus commited on
Commit
35321eb
·
1 Parent(s): b4673e9
FlowAPI.Application/DTOs/User/UserDtos.cs CHANGED
@@ -12,6 +12,7 @@ namespace FlowAPI.Application.DTOs.User
12
  public string? DisplayName { get; set; }
13
  public bool? IsPremium { get; set; }
14
  public string? AvatarUrl { get; set; }
 
15
  }
16
 
17
  public class LoginDto
 
12
  public string? DisplayName { get; set; }
13
  public bool? IsPremium { get; set; }
14
  public string? AvatarUrl { get; set; }
15
+ public string? Password { get; set; }
16
  }
17
 
18
  public class LoginDto
FlowAPI.Application/Services/UserService.cs CHANGED
@@ -111,6 +111,7 @@ namespace FlowAPI.Application.Services
111
  if (dto.DisplayName is not null) user.DisplayName = dto.DisplayName;
112
  if (dto.IsPremium.HasValue) user.IsPremium = dto.IsPremium.Value;
113
  if (dto.AvatarUrl is not null) user.AvatarUrl = dto.AvatarUrl;
 
114
 
115
  var updated = await _repo.UpdateAsync(user);
116
 
 
111
  if (dto.DisplayName is not null) user.DisplayName = dto.DisplayName;
112
  if (dto.IsPremium.HasValue) user.IsPremium = dto.IsPremium.Value;
113
  if (dto.AvatarUrl is not null) user.AvatarUrl = dto.AvatarUrl;
114
+ if (!string.IsNullOrEmpty(dto.Password)) user.PasswordHash = HashPassword(dto.Password);
115
 
116
  var updated = await _repo.UpdateAsync(user);
117