Skip to content

Commit 1b62c17

Browse files
committed
resolves aspnetboilerplate/aspnetboilerplate#6515: override LoginAsync of LoginManager
1 parent 3f20768 commit 1b62c17

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/AbpCompanyName.AbpProjectName.Core/Authorization/LoginManager.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Abp.Authorization;
1+
using System.Threading.Tasks;
2+
using Abp.Authorization;
23
using Abp.Authorization.Users;
34
using Abp.Configuration;
45
using Abp.Configuration.Startup;
@@ -35,5 +36,16 @@ public LogInManager(
3536
roleManager)
3637
{
3738
}
39+
40+
public override async Task<AbpLoginResult<Tenant, User>> LoginAsync(string userNameOrEmailAddress, string plainPassword, string tenancyName = null,
41+
bool shouldLockout = true)
42+
{
43+
return await UnitOfWorkManager.WithUnitOfWorkAsync(async () =>
44+
{
45+
var result = await LoginAsyncInternal(userNameOrEmailAddress, plainPassword, tenancyName, shouldLockout);
46+
await SaveLoginAttempt(result, tenancyName, userNameOrEmailAddress);
47+
return result;
48+
});
49+
}
3850
}
3951
}

0 commit comments

Comments
 (0)