nucleus-core-ts 0.8.146 → 0.8.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,7 +25,15 @@ async function performTokenRefresh(refreshConfig, refreshToken, logger, original
|
|
|
25
25
|
const timeoutId = setTimeout(()=>controller.abort(), timeout);
|
|
26
26
|
try {
|
|
27
27
|
const refreshCookieName = refreshConfig.refreshCookieName ?? 'refresh_token';
|
|
28
|
-
|
|
28
|
+
// Strip the expired access_token from the cookie header so the IDP's
|
|
29
|
+
// auth middleware does not reject the request before the refresh handler runs.
|
|
30
|
+
let cookieHeader;
|
|
31
|
+
if (originalCookieHeader) {
|
|
32
|
+
const stripped = originalCookieHeader.split(';').map((c)=>c.trim()).filter((c)=>!c.startsWith(`${accessCookieName}=`)).join('; ');
|
|
33
|
+
cookieHeader = stripped || `${refreshCookieName}=${refreshToken}`;
|
|
34
|
+
} else {
|
|
35
|
+
cookieHeader = `${refreshCookieName}=${refreshToken}`;
|
|
36
|
+
}
|
|
29
37
|
const response = await fetch(refreshUrl, {
|
|
30
38
|
method: 'POST',
|
|
31
39
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nucleus-core-ts",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.147",
|
|
4
4
|
"description": "Production-ready, enterprise-grade TypeScript framework for building multi-tenant APIs",
|
|
5
5
|
"author": "Hidayet Can Özcan <hidayetcan@gmail.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|