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!")); }
public User ToDomain(UserRequestDto userDto) { return(new User(userDto.Email, _userAuthService.CreateUserSecurity(userDto.Password))); }