diff --git a/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs b/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs index c969771..5d05305 100644 --- a/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs +++ b/src/Fancy.ResourceLinker.Gateway/Authentication/GatewayAuthentication.cs @@ -137,7 +137,7 @@ internal static void AddGatewayAuthentication(IServiceCollection services, Gatew logger.LogInformation("Starting authorization flow for request to: " + context.HttpContext.Request.GetDisplayUrl()); // If the request was made 'from Code aka from javascript' return unauthorized instead of the default redirect // to make visible to a javascript that the authentication is not valid (anymore) - if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest") + if(context.Request.Headers["X-Requested-With"] == "XmlHttpRequest" || context.Request.Headers["Sec-Fetch-Dest"] == "empty") { context.Response.StatusCode = StatusCodes.Status401Unauthorized; context.HandleResponse(); diff --git a/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj b/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj index c63971f..117e1b8 100644 --- a/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj +++ b/src/Fancy.ResourceLinker.Gateway/Fancy.ResourceLinker.Gateway.csproj @@ -1,7 +1,7 @@  - 1.1.0-beta.2 + 1.1.0-beta.3 net8.0 enable enable