You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
??Environment.GetEnvironmentVariable("JWT_SECRET")//Someone added this, why, i do not know, cause the key is stored in the appsettings.json not env variables
427
-
??thrownewInvalidOperationException("A JWT secret is required for token generation.");//Throw if no secret is found
425
+
// Get secret from configuration first, fall back to environment variable
426
+
// Use helper variables to properly handle empty strings (not just null)
varjwtSecretKey=Environment.GetEnvironmentVariable("JWT_SECRET")//I still do not know why this was added, we are reading the Secretkey from appsettings, not the OS env variables
52
-
??config["Secret:SecretKey"];//load our secret
53
-
54
-
if(string.IsNullOrEmpty(jwtSecretKey))
45
+
// Get JWT secret from environment variable (for production/CI) or configuration (for development)
46
+
// Use a helper to treat empty/whitespace strings the same as null
0 commit comments