Add account restrictions, appeals, and admin moderation tools
This commit is contained in:
@@ -21,7 +21,7 @@ import "./community.css";
|
||||
import { themeInitScript } from "@/shared/theme";
|
||||
import { SiteSettingsProvider } from "@/components/SiteSettingsProvider";
|
||||
import { initialSiteSettings } from "@/lib/site-settings";
|
||||
import { user } from "@/lib/supabase";
|
||||
import { rawUser, accountState } from "@/lib/supabase";
|
||||
import { LegacyPasswordNotice } from "@/components/LegacyPasswordNotice";
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const { t } = await getI18n();
|
||||
@@ -41,7 +41,10 @@ export default async function RootLayout({
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const [{ locale, preference, detectedLocale }, settings, account] =
|
||||
await Promise.all([getI18n(), initialSiteSettings(), user()]);
|
||||
await Promise.all([getI18n(), initialSiteSettings(), rawUser()]);
|
||||
const active = account
|
||||
? (await accountState(account.id)) === "active"
|
||||
: false;
|
||||
return (
|
||||
<html lang={locale} data-theme="dark" suppressHydrationWarning>
|
||||
<head>
|
||||
@@ -56,7 +59,7 @@ export default async function RootLayout({
|
||||
<SiteSettingsProvider initialSettings={settings}>
|
||||
{children}
|
||||
<SiteCursor />
|
||||
<LegacyPasswordNotice enabled={!!account?.email} />
|
||||
<LegacyPasswordNotice enabled={active && !!account?.email} />
|
||||
</SiteSettingsProvider>
|
||||
</I18nProvider>
|
||||
<Analytics />
|
||||
|
||||
Reference in New Issue
Block a user