@bridge-ai-dev/ecom-chat 1.0.4 → 1.0.5
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.
- package/package.json +2 -2
- package/templates/route.ts.template +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bridge-ai-dev/ecom-chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Bridge E-commerce Chat widget integration for Next.js with Litium authentication",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"type": "git",
|
|
47
47
|
"url": "https://github.com/bridge-ai/ecom-chat.git"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
|
@@ -11,14 +11,28 @@ import { NextRequest, NextResponse } from "next/server";
|
|
|
11
11
|
*/
|
|
12
12
|
export const GET = async (request: NextRequest) => {
|
|
13
13
|
const cookies = request.cookies;
|
|
14
|
+
|
|
15
|
+
// Debug: Log all available cookie names
|
|
16
|
+
const allCookieNames = cookies.getAll().map(c => c.name);
|
|
17
|
+
console.log('[bridge-auth] All cookie names:', allCookieNames);
|
|
18
|
+
console.log('[bridge-auth] Raw cookie header:', request.headers.get("cookie"));
|
|
14
19
|
|
|
15
20
|
// Retrieve the secure cookies
|
|
16
|
-
// Note: cart-context is now retrieved from the URL query params in the client component
|
|
17
21
|
const identity = cookies.get(".AspNetCore.Identity.Application")?.value;
|
|
22
|
+
const cartContext = cookies.get("x-litium-storefront-cart-context")?.value;
|
|
23
|
+
|
|
24
|
+
// Debug: Log retrieved values
|
|
25
|
+
console.log('[bridge-auth] Identity cookie value:', identity ?? 'NOT FOUND');
|
|
26
|
+
console.log('[bridge-auth] Cart context cookie value:', cartContext ?? 'NOT FOUND');
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
const response = {
|
|
20
29
|
identity: identity || null,
|
|
30
|
+
cart_context: cartContext || null,
|
|
21
31
|
// Optional: Include the raw cookie string if your backend needs it
|
|
22
32
|
raw: request.headers.get("cookie")
|
|
23
|
-
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
console.log('[bridge-auth] Returning response:', JSON.stringify(response, null, 2));
|
|
36
|
+
|
|
37
|
+
return NextResponse.json(response);
|
|
24
38
|
};
|