Files
thoughts/thoughts-frontend/app/settings/api-keys/page.tsx
Gabriel Kaszewski 44385adb6b
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m38s
test / unit (pull_request) Successful in 16m2s
test / integration (pull_request) Failing after 17m2s
feat: update frontend to work with v2 backend — camelCase, new endpoints, nested author
2026-05-14 17:14:27 +02:00

28 lines
818 B
TypeScript

import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { getApiKeys } from "@/lib/api";
import { ApiKeyList } from "@/components/api-keys-list";
export default async function ApiKeysPage() {
const token = (await cookies()).get("auth_token")?.value;
if (!token) {
redirect("/login");
}
const initialApiKeys = await getApiKeys(token).catch(() => ({
keys: [],
}));
return (
<div className="space-y-6">
<div className="glass-effect glossy-effect bottom rounded-md shadow-fa-lg p-4">
<h3 className="text-lg font-medium">API Keys</h3>
<p className="text-sm text-muted-foreground">
Manage API keys for third-party applications.
</p>
</div>
<ApiKeyList initialApiKeys={initialApiKeys.keys} />
</div>
);
}