From 94408aad21821f2b416151bbb0358f4767894018 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 28 May 2026 20:19:19 -0700 Subject: [PATCH] Add path onto redirectUrl --- server/routers/resource/authWithAccessToken.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/routers/resource/authWithAccessToken.ts b/server/routers/resource/authWithAccessToken.ts index a580ee40b..195dbafe2 100644 --- a/server/routers/resource/authWithAccessToken.ts +++ b/server/routers/resource/authWithAccessToken.ts @@ -167,7 +167,12 @@ export async function authWithAccessToken( let redirectUrl = `${resource.ssl ? "https" : "http"}://${resource.fullDomain}`; const postAuthPath = normalizePostAuthPath(resource.postAuthPath); - if (postAuthPath) { + if (tokenItem.path) { + // add the path from the access token to the redirect URL, ensuring there is exactly one slash between the domain and the path + redirectUrl = + redirectUrl.replace(/\/?$/, "/") + + tokenItem.path.replace(/^\/?/, ""); + } else if (postAuthPath) { redirectUrl = redirectUrl + postAuthPath; }