cg / hackerproducts

63 files · 5,740 lines · 159.1 KB — Next.js 15, React 19, TypeScript, PostgreSQL, Object Storage, plain CSS.

Quick jump: page.tsx / page.tsx / globals.css / schema.sql / package.json

root / src / app / settings / page.tsx

src/app/settings/page.tsx · 34 lines · 819 B← back to folder
1import type { Metadata } from "next";
2import { redirect } from "next/navigation";
3import { getCurrentUser } from "@/lib/auth";
4import { ProfileForm } from "@/components/ProfileForm";
5
6export const dynamic = "force-dynamic";
7
8export const metadata: Metadata = {
9 title: "Profile settings",
10 robots: { index: false, follow: false },
11};
12
13export 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
cg / hackerproducts — hacker products