From 882094de03e005181655fb35b18032e3d8a53191 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Fri, 12 Jan 2024 10:58:53 +0100 Subject: [PATCH] feat: reaname settings --- .../Controllers/Api/AuthorizationController.cs | 6 +++--- .../Model/Security/PasswordLoginOptions.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/VirtoCommerce.Platform.Web/Controllers/Api/AuthorizationController.cs b/src/VirtoCommerce.Platform.Web/Controllers/Api/AuthorizationController.cs index f4fa431c119..afc09d4905d 100644 --- a/src/VirtoCommerce.Platform.Web/Controllers/Api/AuthorizationController.cs +++ b/src/VirtoCommerce.Platform.Web/Controllers/Api/AuthorizationController.cs @@ -100,13 +100,13 @@ public async Task Exchange() // Validate the username/password parameters and ensure the account is not locked out. var result = await _signInManager.CheckPasswordSignInAsync(user, openIdConnectRequest.Password, lockoutOnFailure: true); - var context = new Dictionary() + var context = new Dictionary(StringComparer.OrdinalIgnoreCase) { - { "explicitErrors", _passwordLoginOptions.ExplicitErrors }, + { "detailedErrors", _passwordLoginOptions.DetailedErrors }, { "storeId", openIdConnectRequest.Scope }, }; - foreach (var loginValidation in _userSignInValidators.OrderByDescending(x => x.Priority)) + foreach (var loginValidation in _userSignInValidators.OrderByDescending(x => x.Priority).ThenBy(x => x.GetType().Name)) { var validationErrors = await loginValidation.ValidateUserAsync(user, result, context); var error = validationErrors.FirstOrDefault(); diff --git a/src/VirtoCommerce.Platform.Web/Model/Security/PasswordLoginOptions.cs b/src/VirtoCommerce.Platform.Web/Model/Security/PasswordLoginOptions.cs index 3f7147fe54a..ead7dd047f4 100644 --- a/src/VirtoCommerce.Platform.Web/Model/Security/PasswordLoginOptions.cs +++ b/src/VirtoCommerce.Platform.Web/Model/Security/PasswordLoginOptions.cs @@ -10,7 +10,7 @@ public class PasswordLoginOptions public string AuthenticationType { get; set; } = "Password"; - public bool ExplicitErrors { get; set; } + public bool DetailedErrors { get; set; } public int Priority { get; set; } }