feat(platform): add Discord onboarding and Velocity gate

This commit is contained in:
dmg
2026-08-01 13:45:18 -04:00
parent 9d305e5dc9
commit c5de0a1810
80 changed files with 4840 additions and 1572 deletions
+23
View File
@@ -0,0 +1,23 @@
"use server";
import { hashToken, SESSION_COOKIE_NAME } from "@minecraft-account-manager/auth";
import { sessions } from "@minecraft-account-manager/database";
import { eq } from "drizzle-orm";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { db } from "@/lib/database";
export async function logout() {
const cookieStore = await cookies();
const token = cookieStore.get(SESSION_COOKIE_NAME)?.value;
if (token) {
await db
.update(sessions)
.set({ revokedAt: new Date() })
.where(eq(sessions.tokenHash, hashToken(token)));
}
cookieStore.delete(SESSION_COOKIE_NAME);
redirect("/");
}