diff --git a/MareSynchronosServer/MareSynchronosServices/Authentication/SecretKeyAuthenticationHandler.cs b/MareSynchronosServer/MareSynchronosServices/Authentication/SecretKeyAuthenticationHandler.cs index 6caa66c..cdd3579 100644 --- a/MareSynchronosServer/MareSynchronosServices/Authentication/SecretKeyAuthenticationHandler.cs +++ b/MareSynchronosServer/MareSynchronosServices/Authentication/SecretKeyAuthenticationHandler.cs @@ -179,10 +179,14 @@ public class SecretKeyAuthenticationHandler logger.LogInformation("FailedAuthForTempBan: {num}", _failedAttemptsForTempBan); _tempBanMinutes = config.GetValue("TempBanDurationInMinutes", 30); logger.LogInformation("TempBanMinutes: {num}", _tempBanMinutes); - _whitelistedIps = config.GetSection("WhitelistedIps").Get>(); - foreach (var ip in _whitelistedIps) + var whitelisted = config.GetSection("WhitelistedIps"); + if (!string.IsNullOrEmpty(whitelisted.Value)) { - logger.LogInformation("Whitelisted IP: " + ip); + _whitelistedIps = whitelisted.Get>(); + foreach (var ip in _whitelistedIps) + { + logger.LogInformation("Whitelisted IP: " + ip); + } } } } \ No newline at end of file