cg / hackerproducts
63 files · 5,740 lines · 159.1 KB — Next.js 15, React 19, TypeScript, PostgreSQL, Object Storage, plain CSS.
Quick jump: page.tsxpage.tsxglobals.cssschema.sqlpackage.json
root / src / app / settings / page.tsx
src/app/settings/page.tsx · 34 lines · 819 B← back to folder
| 1 | import type { Metadata } from "next"; |
| 2 | import { redirect } from "next/navigation"; |
| 3 | import { getCurrentUser } from "@/lib/auth"; |
| 4 | import { ProfileForm } from "@/components/ProfileForm"; |
| 5 | |
| 6 | export const dynamic = "force-dynamic"; |
| 7 | |
| 8 | export const metadata: Metadata = { |
| 9 | title: "Profile settings", |
| 10 | robots: { index: false, follow: false }, |
| 11 | }; |
| 12 | |
| 13 | export default async function SettingsPage() { |
| 14 | const user = await getCurrentUser(); |
| 15 | if (!user) { |
| 16 | redirect("/login?next=/settings"); |
| 17 | } |
| 18 | |
| 19 | return ( |
| 20 | <div> |
| 21 | <h1>Profile settings</h1> |
| 22 | <p className="subtitle">Update your public maker profile.</p> |
| 23 | <ProfileForm |
| 24 | initial={{ |
| 25 | username: user.username, |
| 26 | bio: user.bio, |
| 27 | website_url: user.website_url, |
| 28 | avatar_url: user.avatar_url, |
| 29 | }} |
| 30 | /> |
| 31 | </div> |
| 32 | ); |
| 33 | } |
| 34 |