Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

登录失败锁定功能调整 #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SecurityTokenService/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ await events.RaiseAsync(new UserLoginFailureEvent(model.Username, "invalid crede
}

var result = await signInManager.PasswordSignInAsync(user, model.Password,
model.RememberLogin, false);
model.RememberLogin, _identityExtensionOptions.LockoutOnFailureOff);
if (result.Succeeded)
{
await events.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id, user.UserName,
Expand Down
5 changes: 5 additions & 0 deletions src/SecurityTokenService/Identity/IdentityExtensionOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ public sealed class IdentityExtensionOptions
/// 表前缀
/// </summary>
public string TablePrefix { get; set; }

/// <summary>
/// 开启失败锁定功能
/// </summary>
public bool LockoutOnFailureOff { get; set; }
}
1 change: 1 addition & 0 deletions src/SecurityTokenService/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"Identity": {
"SoftDeleteColumn": "is_deleted",
"TablePrefix": "wild_goose_",
"LockoutOnFailureOff": true,
"SelfHost": false,
"ClaimsIdentity": {
"EmailClaimType": "email",
Expand Down
Loading