File tree 1 file changed +6
-1
lines changed
modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/Controllers
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,13 @@ await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
108
108
} ) ;
109
109
110
110
string errorDescription ;
111
+ string errorCode ;
112
+
111
113
if ( result . IsLockedOut )
112
114
{
113
115
Logger . LogInformation ( "Authentication failed for username: {username}, reason: locked out" , request . Username ) ;
114
116
errorDescription = "The user account has been locked out due to invalid login attempts. Please wait a while and try again." ;
117
+ errorCode = "account_locked" ;
115
118
}
116
119
else if ( result . IsNotAllowed )
117
120
{
@@ -128,16 +131,18 @@ await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
128
131
}
129
132
130
133
errorDescription = "You are not allowed to login! Your account is inactive or needs to confirm your email/phone number." ;
134
+ errorCode = "account_inactive" ;
131
135
}
132
136
else
133
137
{
134
138
Logger . LogInformation ( "Authentication failed for username: {username}, reason: invalid credentials" , request . Username ) ;
135
139
errorDescription = "Invalid username or password!" ;
140
+ errorCode = OpenIddictConstants . Errors . InvalidGrant ;
136
141
}
137
142
138
143
var properties = new AuthenticationProperties ( new Dictionary < string , string >
139
144
{
140
- [ OpenIddictServerAspNetCoreConstants . Properties . Error ] = OpenIddictConstants . Errors . InvalidGrant ,
145
+ [ OpenIddictServerAspNetCoreConstants . Properties . Error ] = errorCode ,
141
146
[ OpenIddictServerAspNetCoreConstants . Properties . ErrorDescription ] = errorDescription
142
147
} ) ;
143
148
You can’t perform that action at this time.
0 commit comments