From 2285adb9c9a75793d640a9e106425445631262c4 Mon Sep 17 00:00:00 2001 From: prestoncraw Date: Fri, 26 Jun 2026 11:16:58 -0400 Subject: [PATCH] fix redirectURI when consuming application isnt under / basePath --- .../Security/IAuthenticationWebBuilder.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs b/src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs index 840d789e..8617f66a 100644 --- a/src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs +++ b/src/Gemstone.Web/Security/IAuthenticationWebBuilder.cs @@ -172,7 +172,16 @@ private static async Task HandleLogoutRequestAsync(HttpContext httpContext) // If the sign out procedure did not trigger any errors or redirects, // this asks the cookie authentication scheme to redirect to the login page if (IsSuccess(httpContext.Response.StatusCode) && !IsAjaxRequest(httpContext.Request)) - await httpContext.ChallengeAsync(new AuthenticationProperties() { RedirectUri = "/" }); + { + string redirectUri = httpContext.Request.PathBase.HasValue + ? $"{httpContext.Request.PathBase}/" + : "/"; + + await httpContext.ChallengeAsync(new AuthenticationProperties() + { + RedirectUri = redirectUri + }); + } } private static async Task HandleAccessDeniedAsync(HttpContext httpContext)