public ActionResult Register([FromBody] UserRequestDto userRequestDto)
        {
            User user = _userMapper.ToDomain(userRequestDto);

            _userRepository.Save(user);
            return(Ok());
        }
        public ActionResult <string> Authenticate([FromBody] UserRequestDto userRequestDto)
        {
            var securityToken = _userAuthService.Authenticate(userRequestDto.Email, userRequestDto.Password);

            if (securityToken != null)
            {
                return(Ok(securityToken.RawData));
            }

            return(BadRequest("Email or Password incorrect!"));
        }
예제 #3
0
 public User ToDomain(UserRequestDto userDto)
 {
     return(new User(userDto.Email, _userAuthService.CreateUserSecurity(userDto.Password)));
 }