Some checks failed
CI / Tests / 🧪 Test (push) Has been cancelled
Step 16 (account / profile) — landed smaller than scoped because turbo-
starter already ships the full /dashboard/settings flow (avatar, name,
email, language, delete-account) and BetterAuth handles security +
sessions out of the box. Reuses that surface; adds the claudemesh-
specific bits only.
- GET /api/my/export — returns a JSON bundle of the user's profile,
meshes they own, meshes they belong to, invites they've issued, and
audit events from their OWNED meshes (privacy: don't leak events
from meshes merely joined). Limited to 5k audit rows.
- ExportData component on /dashboard/settings — button downloads the
bundle as claudemesh-export-<userId>-<YYYY-MM-DD>.json client-side.
- Sidebar (user group) "settings" label swapped to "account" to match
the Step 16 naming. Same /dashboard/settings route, same existing
i18n key ("account" was already in common.json).
No schema changes: user.name (BetterAuth) IS the mesh display name.
meshMember.displayName is the per-join override that lands from the
CLI at registration time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import { redirect } from "next/navigation";
|
|
|
|
import { pathsConfig } from "~/config/paths";
|
|
import { getSession } from "~/lib/auth/server";
|
|
import { getMetadata } from "~/lib/metadata";
|
|
import { DeleteAccount } from "~/modules/user/settings/general/delete-account";
|
|
import { EditAvatar } from "~/modules/user/settings/general/edit-avatar";
|
|
import { EditEmail } from "~/modules/user/settings/general/edit-email";
|
|
import { EditName } from "~/modules/user/settings/general/edit-name";
|
|
import { ExportData } from "~/modules/user/settings/general/export-data";
|
|
import { LanguageSwitcher } from "~/modules/user/settings/general/language-switcher";
|
|
|
|
export const generateMetadata = getMetadata({
|
|
title: "auth:account.settings.title",
|
|
description: "auth:account.settings.header.description",
|
|
});
|
|
|
|
export default async function SettingsPage() {
|
|
const { user } = await getSession();
|
|
|
|
if (!user) {
|
|
return redirect(pathsConfig.auth.login);
|
|
}
|
|
|
|
return (
|
|
<div className="mx-auto max-w-2xl space-y-6">
|
|
<EditAvatar user={user} />
|
|
<LanguageSwitcher />
|
|
<EditName user={user} />
|
|
<EditEmail user={user} />
|
|
<ExportData />
|
|
<DeleteAccount />
|
|
</div>
|
|
);
|
|
}
|