ThreadCount Community edition

Uniform stock management for healthcare linen rooms. Licensed under the GNU AGPL v3.
This commit is contained in:
ThreadCount
2026-09-13 08:45:19 +10:00
commit 1bc2de655a
505 changed files with 56223 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { NextRequest, NextResponse } from "next/server";
import { clientIp } from "@/lib/ratelimit";
import { clearOpsCookie, currentOperator, logOperatorEvent } from "@/lib/ops/session";
export const dynamic = "force-dynamic";
/* Ends the operator session. Reached by a plain form post from the console, so it answers with a
* redirect rather than JSON. Recorded in the trail when there was a session to end. */
export async function POST(req: NextRequest) {
const op = await currentOperator();
if (op) logOperatorEvent({ operatorId: op.id, action: "ops:signout", ip: clientIp(req.headers) });
await clearOpsCookie();
const url = req.nextUrl.clone();
url.pathname = "/ops/login"; url.search = "";
return NextResponse.redirect(url, { status: 303 });
}