[HttpPost]
public ActionResult<User> GetUserByEmail(string email, string password)
{
var user = context.Users.FirstOrDefault(u => (u.Email == email && u.Password == password));
if(user == null)
{
User temp = new();
temp.IsAuth = false;
return Ok(temp);
}
user.IsAuth = true;
return Ok(user);
}
public class AuthParams
{
public string Email { get; set; }
public string Password { get; set; }
}
public ActionResult<User> GetUserByEmail([FromBody]model AuthParams)
services
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
});