Add account restrictions, appeals, and admin moderation tools
This commit is contained in:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user