Closed
Description
Hi I'm trying to implement Log in method with Identity
public async Task<bool> LoginAsync(LogInHMI loginModel)
{
try
{
var user = await _userManager.FindByNameAsync(loginModel.UserName);
if (user == null)
return false;
var result = await _signInManager.PasswordSignInAsync(user.UserName, loginModel.Password, isPersistent: false, lockoutOnFailure: false);
return result.Succeeded;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
and i'm getting this error:
System.InvalidOperationException: 'Headers are read-only, response has already started.'