Пример #1
0
        public async Task <IActionResult> ChangePassword(string email, string oldPassword, string newPassword)
        {
            try
            {
                var pwdChange = await _authenticationAppService.ChangePassword(email, oldPassword, newPassword);

                if (pwdChange == null)
                {
                    return(BadRequest("Your Password change failed, please check your credentials"));
                }
                return(Ok(pwdChange));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public IActionResult ChangePassword([FromBody] ChangePasswordDto dto)
        {
            _authAppService.ChangePassword(dto.Id, dto.OldPassword, dto.NewPassword);

            return(NoContent());
        }