|
|
|
@ -107,10 +107,13 @@ public partial class TokenController |
|
|
|
ClientId = request.ClientId |
|
|
|
}); |
|
|
|
|
|
|
|
var errorCode = OpenIddictConstants.Errors.InvalidGrant; |
|
|
|
string errorDescription; |
|
|
|
|
|
|
|
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."; |
|
|
|
} |
|
|
|
else if (result.IsNotAllowed) |
|
|
|
@ -139,7 +142,8 @@ public partial class TokenController |
|
|
|
return await HandleConfirmUserAsync(request, user); |
|
|
|
} |
|
|
|
|
|
|
|
errorDescription = "You are not allowed to login! Your account is inactive."; |
|
|
|
errorCode = AbpOpenIddictErrors.AccountInactive; |
|
|
|
errorDescription = "You are not allowed to login! Your account is inactive or needs to confirm your email/phone number."; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
@ -150,7 +154,7 @@ public partial class TokenController |
|
|
|
|
|
|
|
var properties = new AuthenticationProperties(new Dictionary<string, string> |
|
|
|
{ |
|
|
|
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant, |
|
|
|
[OpenIddictServerAspNetCoreConstants.Properties.Error] = errorCode, |
|
|
|
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription |
|
|
|
}); |
|
|
|
|
|
|
|
|