feat: add API keys management page, including API key creation and deletion functionality

This commit is contained in:
2025-09-07 14:06:28 +02:00
parent 862974bb35
commit b337184a59
8 changed files with 303 additions and 10 deletions

View File

@@ -0,0 +1,27 @@
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(() => ({
apiKeys: [],
}));
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.apiKeys} />
</div>
);
}