Files
caddy-proxy-manager/app/(dashboard)/profile/page.tsx
akanealw 99819b70ff
Some checks failed
Build and Push Docker Images (Trusted) / build-and-push (., docker/caddy/Dockerfile, caddy) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/l4-port-manager/Dockerfile, l4-port-manager) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/web/Dockerfile, web) (push) Has been cancelled
Tests / test (push) Has been cancelled
added caddy-proxy-manager for testing
2026-04-21 22:49:08 +00:00

30 lines
795 B
TypeScript
Executable File

import { requireUser } from "@/src/lib/auth";
import { getUserById } from "@/src/lib/models/user";
import { getProviderDisplayList } from "@/src/lib/models/oauth-providers";
import { listApiTokens } from "@/src/lib/models/api-tokens";
import ProfileClient from "./ProfileClient";
import { redirect } from "next/navigation";
export default async function ProfilePage() {
const session = await requireUser();
const userId = Number(session.user.id);
const user = await getUserById(userId);
if (!user) {
redirect("/login");
}
const [enabledProviders, apiTokens] = await Promise.all([
getProviderDisplayList(),
listApiTokens(userId),
]);
return (
<ProfileClient
user={user}
enabledProviders={enabledProviders}
apiTokens={apiTokens}
/>
);
}