Jelszó módosítása
This commit is contained in:
@@ -195,6 +195,48 @@ namespace WorkFlowCheck.Web.Services
|
||||
};
|
||||
}
|
||||
}
|
||||
public async Task<ApiResponseDTO<UserDTO>> Authenticate2F2ChangePassword(string username, string oldpassword, string newpassword, string code, string token2FA)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/Authenticate2F2ChangePassword";
|
||||
|
||||
var userSimpleDTO = new UserChangePassword2FADTO()
|
||||
{
|
||||
UserName = username,
|
||||
OldPassword = oldpassword,
|
||||
NewPassword1 = newpassword,
|
||||
NewPassword2 = newpassword,
|
||||
Code = code,
|
||||
Token2FA = token2FA
|
||||
};
|
||||
|
||||
|
||||
using (HttpResponseMessage httpResponseMessage = await _httpClient.PostAsJsonAsync(endpoint, userSimpleDTO))
|
||||
{
|
||||
httpResponseMessage.EnsureSuccessStatusCode();
|
||||
|
||||
var jsonString = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var response = JsonConvert.DeserializeObject<ApiResponseDTO<UserDTO>>(jsonString);
|
||||
|
||||
return response ?? new ApiResponseDTO<UserDTO>
|
||||
{
|
||||
IsSuccess = false,
|
||||
};
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
return new ApiResponseDTO<UserDTO>
|
||||
{
|
||||
IsSuccess = false
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<bool> DeleteUser(int id)
|
||||
{
|
||||
string endpoint = $"{_httpClient.BaseAddress}api/User/DeleteUser/{id}";
|
||||
@@ -522,6 +564,6 @@ namespace WorkFlowCheck.Web.Services
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user