mirror of
https://github.com/xCyanGrizzly/DragonsStash.git
synced 2026-07-22 23:12:02 +00:00
Some checks failed
continuous-integration/drone/push Build is failing
- Add InviteCode model with code, maxUses, expiry, usage tracking - Registration now requires a valid invite code - New users get USER role instead of ADMIN - Admin-only /invites page to create, manage, and share invite codes - Invite links auto-fill code via ?code= URL param - Drone pipeline now builds app, worker, and bot images separately - Add NEXT_PUBLIC_APP_URL build arg to fix URL redirects
27 lines
813 B
TypeScript
27 lines
813 B
TypeScript
import { auth } from "@/lib/auth";
|
|
import { redirect } from "next/navigation";
|
|
import { PageHeader } from "@/components/shared/page-header";
|
|
import { getInviteCodes } from "./actions";
|
|
import { InviteManager } from "./_components/invite-manager";
|
|
|
|
export default async function InvitesPage() {
|
|
const session = await auth();
|
|
if (!session?.user?.id) redirect("/login");
|
|
if (session.user.role !== "ADMIN") redirect("/dashboard");
|
|
|
|
const inviteCodes = await getInviteCodes();
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<PageHeader
|
|
title="Invite Codes"
|
|
description="Manage invite codes for new user registration"
|
|
/>
|
|
<InviteManager
|
|
inviteCodes={JSON.parse(JSON.stringify(inviteCodes))}
|
|
appUrl={process.env.NEXT_PUBLIC_APP_URL ?? ""}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|