I have the following code below.
public IHttpActionResult Login([FromBody]LoginVM login)
{
bool isAuthenticated = EmployeeSecurity.Login(login.quad, login.password);
if (isAuthenticated)
{
var response = Request.CreateResponse(HttpStatusCode.OK, "Authorized");
response.Headers.Add("Token", "test");
response.Headers.Add("TokenExpiry", "testdate");
response.Headers.Add("Role", "testrol");
response.Headers.Add("Access-Control-Expose-Headers", "Token,TokenExpiry");
return Content(HttpStatusCode.OK, response);
}
return Content(HttpStatusCode.Unauthorized, "Please check your QUAD or password.");
}
I have the following error
"Error getting value from 'ReadTimeout' on 'System.Web.HttpInputStream'.",
I do have the codes below in global.aspx.
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings
.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
GlobalConfiguration.Configuration.Formatters
.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);
Other API endpoints work correctly. What am I doing wrong here?