diff --git a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs index eec642d198..4c42ea6b19 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs @@ -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]