❔ ASP.NET SignInManager PasswordSignInAsync Error

Error: System.InvalidOperationException: Headers are read-only, response has already started.
2 Replies
Protagonist
ProtagonistOP2y ago
private async Task LoginUser()
{
var user = UserManager.GetUserByUsername(username);

if (user != null)
{
var result = await SignInManager.PasswordSignInAsync(username, password, false, false);
if (result.Succeeded)
{
NavigationManager.NavigateTo("/home");
}
else
{
validationMessage = "Invalid username or password.";
}
}
}
private async Task LoginUser()
{
var user = UserManager.GetUserByUsername(username);

if (user != null)
{
var result = await SignInManager.PasswordSignInAsync(username, password, false, false);
if (result.Succeeded)
{
NavigationManager.NavigateTo("/home");
}
else
{
validationMessage = "Invalid username or password.";
}
}
}
the result line is where it crashes and says object reference not set to an instance of an object and also the console error is in the image headers are read only response has already started anyone? top
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?