fix: Remove IsDevelopment() check for authentication mode configuration
- Allow DevelopmentHeader authentication in all environments when configured - Fixes 401 Unauthorized errors in Release mode with DevelopmentHeader config - appsettings.json Authentication.Mode now controls auth regardless of environment Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -234,8 +234,7 @@ var authenticationBuilder = builder.Services
|
||||
options.DefaultChallengeScheme = authenticationScheme;
|
||||
});
|
||||
|
||||
if (builder.Environment.IsDevelopment()
|
||||
&& authenticationMode.Equals("DevelopmentHeader", StringComparison.OrdinalIgnoreCase))
|
||||
if (authenticationMode.Equals("DevelopmentHeader", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
authenticationBuilder.AddScheme<AuthenticationSchemeOptions, DevelopmentHeaderAuthenticationHandler>(
|
||||
authenticationScheme,
|
||||
|
||||
Reference in New Issue
Block a user