fix: some cleanup and fixing runtime bugs, refs NOISSUE
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
public class LdapAuthenticationService : IAuthenticationService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private LdapIntegration _ldapIntegration;
|
||||
|
||||
public LdapAuthenticationService(IConfiguration configuration)
|
||||
public LdapAuthenticationService(IConfiguration configuration, LdapIntegration ldapIntegration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_ldapIntegration = ldapIntegration;
|
||||
}
|
||||
|
||||
public bool Authenticate(string username, string password)
|
||||
{
|
||||
var ldapInstance = LdapIntegration.Instance;
|
||||
return ldapInstance == null ? false : ldapInstance.TestLogin(username, password);
|
||||
return _ldapIntegration == null ? false : _ldapIntegration.TestLogin(username, password);
|
||||
}
|
||||
}
|
@@ -2,11 +2,13 @@ public class PhoneClaimCodeProviderService
|
||||
{
|
||||
private Dictionary<string, string> _phoneClaimCodes;
|
||||
private Dictionary<string, string> _phoneClaimNumbers;
|
||||
private SignalIntegration _signalIntegration;
|
||||
|
||||
public PhoneClaimCodeProviderService()
|
||||
public PhoneClaimCodeProviderService(SignalIntegration signalIntegration)
|
||||
{
|
||||
_phoneClaimCodes = new Dictionary<string, string>();
|
||||
_phoneClaimNumbers = new Dictionary<string, string>();
|
||||
_signalIntegration = signalIntegration;
|
||||
}
|
||||
|
||||
private static Random random = new Random();
|
||||
@@ -32,7 +34,10 @@ public class PhoneClaimCodeProviderService
|
||||
_phoneClaimNumbers[username] = phoneNumber;
|
||||
}
|
||||
|
||||
await SignalIntegration.Instance.SendMessageToUserAsync("Your phone number validation code is: " + generatedCode, phoneNumber);
|
||||
if (_signalIntegration != null)
|
||||
{
|
||||
await _signalIntegration.SendMessageToUserAsync("Your phone number validation code is: " + generatedCode, phoneNumber);
|
||||
}
|
||||
}
|
||||
|
||||
public string ValidateClaimCodeForUser(string code, string username)
|
||||
|
Reference in New Issue
Block a user