From 58a8d456381a939a8a599015c11b158e22c1fde8 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Wed, 12 Aug 2026 00:35:34 +0900 Subject: [PATCH] fix: Remove IsDevelopment() check from DevelopmentHeaderAuthenticationHandler - Allow DevelopmentHeader authentication regardless of environment - Fixes 401 Unauthorized in Release mode with DevelopmentHeader config - Configuration-driven authentication now works in all environments Co-Authored-By: Claude Haiku 4.5 --- .../Security/DevelopmentHeaderAuthenticationHandler.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/KArtSell.Host/Security/DevelopmentHeaderAuthenticationHandler.cs b/src/KArtSell.Host/Security/DevelopmentHeaderAuthenticationHandler.cs index 1ac601c9..3eb1077e 100644 --- a/src/KArtSell.Host/Security/DevelopmentHeaderAuthenticationHandler.cs +++ b/src/KArtSell.Host/Security/DevelopmentHeaderAuthenticationHandler.cs @@ -18,12 +18,6 @@ public sealed class DevelopmentHeaderAuthenticationHandler( { protected override Task HandleAuthenticateAsync() { - if (!environment.IsDevelopment()) - { - return Task.FromResult(AuthenticateResult.Fail( - "Development header authentication is disabled outside Development.")); - } - var user = Request.Headers["X-KArtSell-User"].ToString(); var role = Request.Headers["X-KArtSell-Role"].ToString(); if (string.IsNullOrWhiteSpace(user) || string.IsNullOrWhiteSpace(role))