Return 401 in case the signin was not successfully (#16258)
This commit is contained in:
@@ -94,7 +94,15 @@ public class BackOfficeController : SecurityControllerBase
|
||||
EnabledTwoFactorProviderNames = enabledProviders
|
||||
});
|
||||
}
|
||||
return Ok();
|
||||
|
||||
if (result.Succeeded)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
return StatusCode(StatusCodes.Status401Unauthorized, new ProblemDetailsBuilder()
|
||||
.WithTitle("Invalid credentials")
|
||||
.WithDetail("The provided credentials are invalid. User has not been signed in.")
|
||||
.Build());
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
|
||||
Reference in New Issue
Block a user