diff --git a/MainProject/Utils/CryptoUtils.cs b/MainProject/Utils/CryptoUtils.cs index 5298ad6..55910ce 100644 --- a/MainProject/Utils/CryptoUtils.cs +++ b/MainProject/Utils/CryptoUtils.cs @@ -9,7 +9,7 @@ public class CryptUtils private readonly string secretKey; private const int M = 16; private const int N = 32; - private readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); + public CryptUtils(AppSettings appSettings) { secretKey = appSettings.EncryptionSettings?.Salt ?? String.Empty; diff --git a/MainProject/Utils/JwtTokenUtils.cs b/MainProject/Utils/JwtTokenUtils.cs index 170da6f..0b8de7d 100644 --- a/MainProject/Utils/JwtTokenUtils.cs +++ b/MainProject/Utils/JwtTokenUtils.cs @@ -62,8 +62,8 @@ public class JwtTokenUtils return guid; } - string[]? authorizations = headerAuthorization.Split(" "); - if (authorizations != null && authorizations.Length == 2) + string[] authorizations = headerAuthorization.Split(" "); + if (authorizations.Length == 2) { token = authorizations[1]; } @@ -97,8 +97,9 @@ public class JwtTokenUtils } } } - catch + catch(Exception exception) { + Logger.Error($"[JwtTokenUtils][ValidateToken] | {exception.Message}"); return guid; } }