1
- using System ;
2
1
using System . Collections . Generic ;
3
2
using System . Threading . Tasks ;
4
3
using VirtoCommerce . Platform . Security . Model ;
@@ -15,24 +14,33 @@ public Task<IList<TokenLoginResponse>> ValidateUserAsync(SignInValidatorContext
15
14
16
15
if ( ! context . IsSucceeded )
17
16
{
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 ( ) ) ;
27
18
}
28
- else
19
+ else if ( context . User . PasswordExpired )
29
20
{
30
- if ( context . User . PasswordExpired )
31
- {
32
- result . Add ( SecurityErrorDescriber . PasswordExpired ( ) ) ;
33
- }
21
+ result . Add ( SecurityErrorDescriber . PasswordExpired ( ) ) ;
34
22
}
35
23
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
+
36
44
return Task . FromResult < IList < TokenLoginResponse > > ( result ) ;
37
45
}
38
46
}
0 commit comments