Skip to content

Commit

Permalink
Session
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 7, 2025
1 parent 5e4757c commit bf78b4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
10 changes: 1 addition & 9 deletions apps/api/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,10 @@ export const setupAuth = (c: Context) => {
enabled: true,
maxAge: 5 * 60,
},
// cookieOptions: {
// httpOnly: true,
// secure: true,
// sameSite: "lax",
// domain: ".languine.ai",
// path: "*",
// partitioned: false,
// },
},
advanced: {
crossSubDomainCookies: {
enabled: true,
enabled: !c.env.BETTER_AUTH_BASE_URL?.includes("localhost"),
domain: ".languine.ai",
},
},
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import type { AppType } from "@languine/api";
import { hc } from "hono/client";
import { cookies } from "next/headers";

export async function createClient() {
const cookiesList = await cookies();
const cookieHeader = cookiesList
.getAll()
.map((c) => `${c.name}=${c.value}`)
.join("; ");

return hc<AppType>(process.env.NEXT_PUBLIC_API_ENDPOINT!, {
headers: {
cookie: cookieHeader,
credentials: "include",
},
});
}

0 comments on commit bf78b4f

Please sign in to comment.