Example #1
0
        public async Task <IActionResult> ChangePassword(ChangePasswordDto dto)
        {
            try
            {
                var response = await _client.ChangePasswordAsync(dto);

                if (!string.IsNullOrEmpty(response.Error))
                {
                    if (response.Error == ErrorMessages.UserNotFound)
                    {
                        return(HandleNotFound(response.Error));
                    }

                    return(HandleBadRequest(response.Error));
                }

                return(HandleOk());
            }
            catch (Exception e)
            {
                return(HandleBadGateway(e.Message));
            }
        }