From 592707658c3fee59a76241ac0f40a2fb54bf970c Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 10 Dec 2025 00:58:45 +0100 Subject: [PATCH] fix(api): :ambulance: Fix OpenID authentication failing because of search params being stripped --- bun.lock | 3 +++ package.json | 3 +++ patches/openid-client@6.8.1.patch | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 patches/openid-client@6.8.1.patch diff --git a/bun.lock b/bun.lock index ee1ecd27..e719a635 100644 --- a/bun.lock +++ b/bun.lock @@ -227,6 +227,9 @@ "msgpackr-extract", "protobufjs", ], + "patchedDependencies": { + "openid-client@6.8.1": "patches/openid-client@6.8.1.patch", + }, "catalog": { "@biomejs/biome": "2.3.4", "@bull-board/api": "~6.14.2", diff --git a/package.json b/package.json index 4ca3c50a..97c1c85c 100644 --- a/package.json +++ b/package.json @@ -215,5 +215,8 @@ "zod": "catalog:", "zod-openapi": "catalog:", "zod-validation-error": "catalog:" + }, + "patchedDependencies": { + "openid-client@6.8.1": "patches/openid-client@6.8.1.patch" } } diff --git a/patches/openid-client@6.8.1.patch b/patches/openid-client@6.8.1.patch new file mode 100644 index 00000000..3f28cef8 --- /dev/null +++ b/patches/openid-client@6.8.1.patch @@ -0,0 +1,14 @@ +diff --git a/build/index.js b/build/index.js +index 8bea9f9d4413ecf2446ee5130b46e58d5ac37226..b1b9e89c1ac3b6bf6ac82fef94ccf92b55a40321 100644 +--- a/build/index.js ++++ b/build/index.js +@@ -888,7 +888,8 @@ export function useIdTokenResponseType(config) { + } + function stripParams(url) { + url = new URL(url); +- url.search = ''; ++ // Remove all params except user_id, link, and flow ++ url.search = new URLSearchParams([...url.searchParams].filter(([k]) => ['user_id', 'link', 'flow'].includes(k))).toString(); + url.hash = ''; + return url.href; + }