fix(api): 🚑 Fix OpenID authentication failing because of search params being stripped

This commit is contained in:
Jesse Wierzbinski 2025-12-10 00:58:45 +01:00
parent 4807f3f393
commit 592707658c
No known key found for this signature in database
3 changed files with 20 additions and 0 deletions

View file

@ -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",

View file

@ -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"
}
}

View file

@ -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;
}