Beispiel #1
0
        public async Task <IActionResult> ResetPassword([FromBody] User user)
        {
            try
            {
                var responseOnReset = await _handler.ResetPassword(user);

                return(StatusCode(StatusCodes.Status202Accepted, responseOnReset.ToString()));
            }
            catch (Exception e)
            {
                if (e is ServerException)
                {
                    return(StatusCode(StatusCodes.Status500InternalServerError, new ErrorResponse(error: Text.ServerException, errorMessage: e.ToString()).ToString()));
                }
                return(StatusCode(StatusCodes.Status500InternalServerError, new ErrorResponse(error: Text.InternalServerError, errorMessage: e.ToString()).ToString()));
            }
        }