Skip to content

Commit

Permalink
ugly fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua committed Oct 31, 2024
1 parent 33748ef commit 74d45df
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions examples/oak.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Application, Router } from "@oak/oak";
import {
MemoryStore,
Session,
} from "https://deno.land/x/[email protected]/mod.ts";
import { Application, type Middleware, Router } from "@oak/oak";
import { Session } from "https://deno.land/x/[email protected]/mod.ts";
import { OAuth2Client } from "@cmd-johnson/deno-oauth2-client";

const oauth2Client = new OAuth2Client({
Expand Down Expand Up @@ -72,20 +69,7 @@ const app = new Application<AppState>();
app.keys = ["super-secret-key"];

// Set up the session middleware
const sessionStore = new MemoryStore();
app.use(Session.initMiddleware(sessionStore, {
cookieSetOptions: {
httpOnly: true,
sameSite: "lax",
// Enable for when running outside of localhost
// secure: true,
signed: true,
},
cookieGetOptions: {
signed: true,
},
expireAfterSeconds: 60 * 10,
}));
app.use(Session.initMiddleware() as unknown as Middleware<AppState>);

// Mount the router
app.use(router.allowedMethods(), router.routes());
Expand Down

0 comments on commit 74d45df

Please sign in to comment.