Skip to content

Commit dee2929

Browse files
committed
fix: test
1 parent 490b005 commit dee2929

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

src/VirtoCommerce.Platform.Security/Services/BaseUserSignInValidator.cs

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Threading.Tasks;
43
using VirtoCommerce.Platform.Security.Model;
@@ -15,24 +14,33 @@ public Task<IList<TokenLoginResponse>> ValidateUserAsync(SignInValidatorContext
1514

1615
if (!context.IsSucceeded)
1716
{
18-
if (!context.DetailedErrors)
19-
{
20-
result.Add(SecurityErrorDescriber.LoginFailed());
21-
}
22-
else if (context.IsLockedOut)
23-
{
24-
var permanentLockOut = context.User.LockoutEnd == DateTime.MaxValue.ToUniversalTime();
25-
result.Add(permanentLockOut ? SecurityErrorDescriber.UserIsLockedOut() : SecurityErrorDescriber.UserIsTemporaryLockedOut());
26-
}
17+
result.Add(SecurityErrorDescriber.LoginFailed());
2718
}
28-
else
19+
else if (context.User.PasswordExpired)
2920
{
30-
if (context.User.PasswordExpired)
31-
{
32-
result.Add(SecurityErrorDescriber.PasswordExpired());
33-
}
21+
result.Add(SecurityErrorDescriber.PasswordExpired());
3422
}
3523

24+
//if (!context.IsSucceeded)
25+
//{
26+
// if (!context.DetailedErrors)
27+
// {
28+
// result.Add(SecurityErrorDescriber.LoginFailed());
29+
// }
30+
// else if (context.IsLockedOut)
31+
// {
32+
// var permanentLockOut = context.User.LockoutEnd == DateTime.MaxValue.ToUniversalTime();
33+
// result.Add(permanentLockOut ? SecurityErrorDescriber.UserIsLockedOut() : SecurityErrorDescriber.UserIsTemporaryLockedOut());
34+
// }
35+
//}
36+
//else
37+
//{
38+
// if (context.User.PasswordExpired)
39+
// {
40+
// result.Add(SecurityErrorDescriber.PasswordExpired());
41+
// }
42+
//}
43+
3644
return Task.FromResult<IList<TokenLoginResponse>>(result);
3745
}
3846
}

0 commit comments

Comments
 (0)