|
|
|
@ -107,14 +107,14 @@ public partial class TokenController |
|
|
|
ClientId = request.ClientId |
|
|
|
}); |
|
|
|
|
|
|
|
var errorCode = OpenIddictConstants.Errors.InvalidGrant; |
|
|
|
string errorDescription; |
|
|
|
string errorCode; |
|
|
|
|
|
|
|
|
|
|
|
if (result.IsLockedOut) |
|
|
|
{ |
|
|
|
Logger.LogInformation("Authentication failed for username: {username}, reason: locked out", request.Username); |
|
|
|
errorCode = AbpOpenIddictErrors.AccountLocked; |
|
|
|
errorDescription = "The user account has been locked out due to invalid login attempts. Please wait a while and try again."; |
|
|
|
errorCode = "account_locked"; |
|
|
|
} |
|
|
|
else if (result.IsNotAllowed) |
|
|
|
{ |
|
|
|
@ -127,7 +127,6 @@ public partial class TokenController |
|
|
|
{ |
|
|
|
Logger.LogInformation("Authentication failed for username: {username}, reason: not allowed", request.Username); |
|
|
|
|
|
|
|
|
|
|
|
if (user.ShouldChangePasswordOnNextLogin) |
|
|
|
{ |
|
|
|
return await HandleShouldChangePasswordOnNextLoginAsync(request, user, request.Password); |
|
|
|
@ -143,15 +142,14 @@ public partial class TokenController |
|
|
|
return await HandleConfirmUserAsync(request, user); |
|
|
|
} |
|
|
|
|
|
|
|
errorCode = AbpOpenIddictErrors.AccountInactive; |
|
|
|
errorDescription = "You are not allowed to login! Your account is inactive or needs to confirm your email/phone number."; |
|
|
|
errorCode = "account_inactive"; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Logger.LogInformation("Authentication failed for username: {username}, reason: invalid credentials", request.Username); |
|
|
|
errorDescription = "Invalid username or password!"; |
|
|
|
errorCode = OpenIddictConstants.Errors.InvalidGrant; |
|
|
|
} |
|
|
|
|
|
|
|
var properties = new AuthenticationProperties(new Dictionary<string, string> |
|
|
|
|