mój kontroller, pikam pod ten endpoint postmanem i dostaję pusty obiekt {}
response jest łądnie wypełniony.
dlaczego?
[HttpPost("login")]
public ActionResult<AuthenticateResponse> Login([FromBody]LoginDto dto)
{
User user = _accountService.LoginUser(dto);
string token = _accountService.GenerateJwt(user);
AuthenticateResponse response = AuthenticateResponse.Ok(UserDto.of(user, token));
return response;
}
public class AuthenticateResponse
{
UserDto user;
string error;
public static AuthenticateResponse Ok(UserDto user)
{
AuthenticateResponse response = new AuthenticateResponse();
response.user = user;
return response;
}
public static AuthenticateResponse Error(string error)
{
AuthenticateResponse response = new AuthenticateResponse();
response.error = error;
return response;
}
}