import config from "@payload-config"; import { getPayload } from "payload"; import { headers as nextHeaders } from "next/headers"; import { redirect } from "next/navigation"; import { UserCogIcon } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { AccountProfileForm } from "@/components/frontend/account/AccountProfileForm"; import { ChangePasswordForm } from "@/components/frontend/account/ChangePasswordForm"; import { DiscordUsernameRequestForm } from "@/components/frontend/account/DiscordUsernameRequestForm"; import { PreferencesForm } from "@/components/frontend/account/PreferencesForm"; export const metadata = { title: "Account — Polaris Task Force", }; export default async function AccountPage() { const payload = await getPayload({ config }); const { user } = await payload.auth({ headers: await nextHeaders(), canSetHeaders: false, }); if (!user) { redirect("/"); } const fullUser = await payload.findByID({ collection: "users", id: user.id, depth: 0, overrideAccess: true, }); const notifications = fullUser.preferences?.notifications; const discord = fullUser.preferences?.discord; return (

Account

Manage your profile, password, and notification preferences.

Profile How your name appears across the platform. Password Change your password. You will stay logged in on this device. Discord Username Your Discord username is managed by leadership. Request a change here. Preferences Control in-app notifications and display options.
); }