feat: LdapOptions erstellt anstelle statischer (fest codierter) Konfigurationswerte, LdapOptions und Abhängigkeitsinjektionen dafür hinzugefügt
This commit is contained in:
@@ -18,10 +18,13 @@ namespace StaffDBServer.SharedControllers
|
||||
|
||||
WebAppEmployeeInfoRepository webAppEmployeeInfoRepository;
|
||||
|
||||
public WebAppUserHelper(WebAppUserRepository webAppUserRepository, WebAppEmployeeInfoRepository webAppEmployeeInfoRepository)
|
||||
private readonly JwtManager _jwtManager;
|
||||
|
||||
public WebAppUserHelper(WebAppUserRepository webAppUserRepository, WebAppEmployeeInfoRepository webAppEmployeeInfoRepository, JwtManager jwtManager)
|
||||
{
|
||||
this.webAppUserRepository = webAppUserRepository;
|
||||
this.webAppEmployeeInfoRepository = webAppEmployeeInfoRepository;
|
||||
_jwtManager = jwtManager;
|
||||
}
|
||||
|
||||
public async Task<WebAppUser> CheckLoginWithJWTAsync(StringValues accessToken, string clientVersion)
|
||||
@@ -96,7 +99,7 @@ namespace StaffDBServer.SharedControllers
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<WebAppUser> DoCheckLoginWithNameAndPasswordAsync(WebAppUser userFromClient, WebAppUserRepository webAppUserRepository, WebAppEmployeeInfoRepository webAppEmployeeInfoRepository)
|
||||
private async Task<WebAppUser> DoCheckLoginWithNameAndPasswordAsync(WebAppUser userFromClient, WebAppUserRepository webAppUserRepository, WebAppEmployeeInfoRepository webAppEmployeeInfoRepository)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -114,7 +117,7 @@ namespace StaffDBServer.SharedControllers
|
||||
}
|
||||
|
||||
LdapUser ldapUser = new LdapUser(userFromClient.LoginName, webAppEmployeeInfo.EmployeeId, userFromClient.Password, webAppEmployeeInfo.DepartmentId, webAppEmployeeInfo.ExtendedDepartmentIdList);
|
||||
if (!JwtManager.GenerateLdapUserWithJwtToken(ldapUser))
|
||||
if (!_jwtManager.GenerateLdapUserWithJwtToken(ldapUser))
|
||||
{
|
||||
if (ldapUser == default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user