Skip to content

Commit 00b2ecc

Browse files
committed
fix: test
1 parent 5e1a54c commit 00b2ecc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/VirtoCommerce.Platform.Web/Controllers/Api/AuthorizationController.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,20 @@ public async Task<ActionResult> Exchange()
100100
// Validate the username/password parameters and ensure the account is not locked out.
101101
var result = await _signInManager.CheckPasswordSignInAsync(user, openIdConnectRequest.Password, lockoutOnFailure: true);
102102

103-
if (!result.Succeeded)
103+
var context = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase)
104104
{
105-
return BadRequest(SecurityErrorDescriber.LoginFailed());
105+
{ "detailedErrors", _passwordLoginOptions.DetailedErrors },
106+
};
107+
108+
var storeId = openIdConnectRequest.GetParameter("storeId");
109+
if (storeId != null)
110+
{
111+
context.Add("storeId", storeId.Value);
106112
}
107113

108114
foreach (var loginValidation in _userSignInValidators.OrderByDescending(x => x.Priority).ThenBy(x => x.GetType().Name).ToList())
109115
{
110-
var validationErrors = await loginValidation.ValidateUserAsync(user, result, new Dictionary<string, object>());
116+
var validationErrors = await loginValidation.ValidateUserAsync(user, result, context);
111117
var error = validationErrors.FirstOrDefault();
112118
if (error != null)
113119
{

0 commit comments

Comments
 (0)