MCPcopy Create free account
hub / github.com/emwalker/digraph / POST

Function POST

next/app/session/route.ts:8–23  ·  view source on GitHub ↗
(request: NextRequest)

Source from the content-addressed store, hash-verified

6
7// login
8export async function POST(request: NextRequest) {
9 const session = await getIronSession<SessionData>(cookies(), sessionOptions)
10
11 const { username = 'No username' } = (await request.json()) as {
12 username: string;
13 }
14
15 session.isLoggedIn = true
16 session.username = username
17 await session.save()
18
19 // simulate looking up the user in db
20 await sleep(250)
21
22 return Response.json(session)
23}
24
25// read session
26export async function GET() {

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
saveMethod · 0.80

Tested by

no test coverage detected