Add account restrictions, appeals, and admin moderation tools

This commit is contained in:
2026-10-13 12:32:37 +05:00
parent 018be5049e
commit cfe5820802
28 changed files with 1936 additions and 125 deletions

View File

@@ -2,7 +2,7 @@ import { getI18n } from "@/lib/i18n";
import { redirect } from "next/navigation";
import { Header, Footer } from "@/components/Shell";
import { SignIn } from "@/components/SignIn";
import { user } from "@/lib/supabase";
import { rawUser, accountState } from "@/lib/supabase";
import { authDestination } from "@/shared/account";
export async function generateMetadata() {
const { t } = await getI18n();
@@ -15,8 +15,10 @@ export default async function LogIn({
}) {
const query = await searchParams;
const next = authDestination(query.next);
if (await user())
redirect(next === "/auth/reset-password" ? "/settings" : next);
const account = await rawUser();
if (account && (await accountState(account.id)) !== "active")
redirect("/ban/appeal");
if (account) redirect(next === "/auth/reset-password" ? "/settings" : next);
return (
<>
<Header />