Skip to content

Commit

Permalink
Cookie store support
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshschuler committed May 30, 2023
1 parent e7540d5 commit 68dfbbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { handleError } from "@/middleware/handleError.ts";
import { logRequest } from "@/middleware/logRequest.ts";
import { setupRoutes } from "@/routes.ts";
import { oakCors } from "https://deno.land/x/cors/mod.ts";
import { Session } from "https://deno.land/x/oak_sessions/mod.ts";
import { CookieStore, Session } from "https://deno.land/x/oak_sessions/mod.ts";
import { Application, Router } from "oak";

type AppState = {
Expand All @@ -13,8 +13,8 @@ type AppState = {
const app = new Application<AppState>();

export const router = new Router<AppState>();

app.use(Session.initMiddleware(undefined, {
const store = new CookieStore(Deno.env.get("COOKIE_STORE_SECRET")!);
app.use(Session.initMiddleware(store, {
cookieSetOptions: {
httpOnly: true,
sameSite: "lax",
Expand Down

0 comments on commit 68dfbbe

Please sign in to comment.