示例#1
0
        public IActionResult SendPasswordToken([FromBody] UserDto userDto)
        {
            try
            {
                var passwordToken = UsersService.CreateActivationKey();

                UsersService.AddPasswordTokenToTable(passwordToken, UsersService.FindUser(userDto.Email));

                UsersService.SendPasswordToken(userDto.Email, passwordToken);

                return(Ok());
            }
            catch (Exception ex)
            {
                // return error message if there was an exception
                return(BadRequest(new { message = ex.Message }));
            }
        }