Skip to content

Commit 5f7a223

Browse files
committed
Merge branch 'development' into staging
2 parents 18a3760 + deaf754 commit 5f7a223

File tree

38 files changed

+1048
-253
lines changed

38 files changed

+1048
-253
lines changed

src/client/app/api/auth/refresh-session/route.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ import { auth0 } from "@lib/auth0"
44
// This route is only for Auth0 environments
55
export async function GET(request) {
66
if (process.env.NEXT_PUBLIC_ENVIRONMENT === "selfhost") {
7-
return NextResponse.json({
8-
status: "ok",
9-
message: "Self-host mode, no refresh needed."
10-
})
7+
return NextResponse.json(
8+
{
9+
status: "ok",
10+
message: "Self-host mode, no refresh needed."
11+
},
12+
{
13+
headers: { "Cache-Control": "no-store, max-age=0" }
14+
}
15+
)
1116
}
1217

1318
const res = new NextResponse()
@@ -26,11 +31,13 @@ export async function GET(request) {
2631
refresh: true
2732
})
2833

34+
const newHeaders = new Headers(res.headers)
35+
newHeaders.set("Cache-Control", "no-store, max-age=0")
2936
// The new session cookie is now on the `res` object.
3037
// Return a success response with the new headers.
3138
return NextResponse.json(
3239
{ status: "ok" },
33-
{ status: 200, headers: res.headers }
40+
{ status: 200, headers: newHeaders }
3441
)
3542
} catch (error) {
3643
console.error("Error refreshing session in main app:", error.message)

src/client/app/api/auth/token/route.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export async function GET() {
1515
{ status: 500 }
1616
)
1717
}
18-
return NextResponse.json({ accessToken: token })
18+
return NextResponse.json(
19+
{ accessToken: token },
20+
{
21+
headers: { "Cache-Control": "no-store, max-age=0" }
22+
}
23+
)
1924
}
2025
try {
2126
const tokenResult = await auth0.getAccessToken()
@@ -27,7 +32,12 @@ export async function GET() {
2732
{ status: 401 }
2833
)
2934
}
30-
return NextResponse.json({ accessToken: token })
35+
return NextResponse.json(
36+
{ accessToken: token },
37+
{
38+
headers: { "Cache-Control": "no-store, max-age=0" }
39+
}
40+
)
3141
} catch (error) {
3242
console.error("Error in /api/auth/token:", error)
3343
// If the error is specifically because of a missing session,

src/client/app/api/files/download/[...filename]/route.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export const GET = withAuth(async function GET(
5353
status: 200,
5454
headers: {
5555
"Content-Type": "application/octet-stream",
56-
"Content-Disposition": `attachment; filename="${filename}"`
56+
"Content-Disposition": `attachment; filename="${filename}"`,
57+
"Cache-Control": "no-store, max-age=0"
5758
}
5859
})
5960
} catch (error) {

src/client/app/api/files/list/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1717
if (!response.ok) {
1818
throw new Error(data.detail || "Failed to list files")
1919
}
20-
return NextResponse.json(data)
20+
return NextResponse.json(data, {
21+
headers: { "Cache-Control": "no-store, max-age=0" }
22+
})
2123
} catch (error) {
2224
console.error("API Error in /files/list:", error)
2325
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/integrations/connected/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
2020
if (!response.ok) {
2121
throw new Error(data.detail || "Failed to fetch integrations")
2222
}
23-
return NextResponse.json(data)
23+
return NextResponse.json(data, {
24+
headers: { "Cache-Control": "no-store, max-age=0" }
25+
})
2426
} catch (error) {
2527
console.error("API Error in /integrations/connected:", error)
2628
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/memories/graph/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
2020
if (!response.ok) {
2121
throw new Error(data.detail || "Failed to fetch memory graph data")
2222
}
23-
return NextResponse.json(data)
23+
return NextResponse.json(data, {
24+
headers: { "Cache-Control": "no-store, max-age=0" }
25+
})
2426
} catch (error) {
2527
console.error("API Error in /memories/graph:", error)
2628
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/memories/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
2020
if (!response.ok) {
2121
throw new Error(data.detail || "Failed to fetch memories")
2222
}
23-
return NextResponse.json(data)
23+
return NextResponse.json(data, {
24+
headers: { "Cache-Control": "no-store, max-age=0" }
25+
})
2426
} catch (error) {
2527
console.error("API Error in /memories:", error)
2628
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/notifications/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
1818
if (!response.ok) {
1919
throw new Error(data.detail || "Failed to fetch notifications")
2020
}
21-
return NextResponse.json(data)
21+
return NextResponse.json(data, {
22+
headers: { "Cache-Control": "no-store, max-age=0" }
23+
})
2224
} catch (error) {
2325
console.error("API Error in /notifications:", error)
2426
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/search/route.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
3030
if (!response.ok) {
3131
throw new Error(data.detail || "Failed to perform search")
3232
}
33-
return NextResponse.json(data)
33+
return NextResponse.json(data, {
34+
headers: { "Cache-Control": "no-store, max-age=0" }
35+
})
3436
} catch (error) {
3537
console.error("API Error in /api/search:", error)
3638
return NextResponse.json({ error: error.message }, { status: 500 })

src/client/app/api/settings/google-auth/route.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
2020
const data = await response.json()
2121
const googleAuthMode = data?.data?.googleAuth?.mode || "default"
2222

23-
return NextResponse.json({ mode: googleAuthMode })
23+
return NextResponse.json(
24+
{ mode: googleAuthMode },
25+
{
26+
headers: { "Cache-Control": "no-store, max-age=0" }
27+
}
28+
)
2429
} catch (error) {
2530
console.error("API Error in /settings/google-auth (GET):", error)
2631
return NextResponse.json(

0 commit comments

Comments
 (0)