add auth
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
"use client";
|
||||
|
||||
export function EndgameForm() {
|
||||
return <form></form>;
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
import { Blocker } from "@/components/blocker";
|
||||
import { EndgameForm } from "./form";
|
||||
|
||||
export default async function EndgamePage() {
|
||||
return (
|
||||
<div className="flex h-full w-full justify-center items-center">
|
||||
<div className="rounded flex flex-col bg-card border p-2">
|
||||
<form>
|
||||
<div className="grid gap-2">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<Blocker>ขณะนี้คิวเต็มแล้ว</Blocker>
|
||||
<h1>รับลงเอนเกคอนเท้น</h1>
|
||||
<EndgameForm />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { betterAuth } from "better-auth";
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import { admin } from "better-auth/plugins";
|
||||
import { headers } from "next/headers";
|
||||
import { db } from "$/db"; // your drizzle instance
|
||||
import * as schema from "$/db/schema";
|
||||
@@ -9,6 +10,13 @@ export const auth = betterAuth({
|
||||
enabled: true,
|
||||
disableSignUp: true,
|
||||
},
|
||||
socialProviders: {
|
||||
discord: {
|
||||
enabled: true,
|
||||
clientId: "1397024670355554336",
|
||||
},
|
||||
},
|
||||
plugins: [admin()],
|
||||
trustedOrigins: [
|
||||
"http://nyx:3000",
|
||||
"http://astral:3000",
|
||||
|
||||
@@ -102,6 +102,32 @@ export const artifactSettings = artifact.table("settings", {
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Artifact
|
||||
export const endgame = pgSchema("endgame");
|
||||
|
||||
export const endgameSubmissions = endgame.table("submissions", {
|
||||
id: text().primaryKey().$defaultFn(uuidv7),
|
||||
name: text().notNull(),
|
||||
user: text().notNull(),
|
||||
slip: bytea().notNull(),
|
||||
char: text()
|
||||
.notNull()
|
||||
.references(() => characters.name, {
|
||||
onDelete: "cascade",
|
||||
onUpdate: "cascade",
|
||||
}),
|
||||
queue: serial(),
|
||||
checked: boolean().notNull().default(false),
|
||||
});
|
||||
|
||||
export const endgameSettings = endgame.table("settings", {
|
||||
id: boolean().primaryKey().default(true),
|
||||
locked: boolean().notNull().default(false),
|
||||
limit: integer().notNull().default(-1),
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Tierlist
|
||||
export const tierlist = pgSchema("tierlist");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user