mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-15 23:30:17 +02:00
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { internal } from "@app/lib/api";
|
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
|
import { AxiosResponse } from "axios";
|
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
|
import IdpTable, { IdpRow } from "@app/components/OrgIdpTable";
|
|
import { getTranslations } from "next-intl/server";
|
|
import { PaidFeaturesAlert } from "@app/components/PaidFeaturesAlert";
|
|
import { IdpGlobalModeBanner } from "@app/components/IdpGlobalModeBanner";
|
|
import { tierMatrix } from "@server/lib/billing/tierMatrix";
|
|
|
|
type OrgIdpPageProps = {
|
|
params: Promise<{ orgId: string }>;
|
|
};
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function OrgIdpPage(props: OrgIdpPageProps) {
|
|
const params = await props.params;
|
|
|
|
let idps: IdpRow[] = [];
|
|
try {
|
|
const res = await internal.get<AxiosResponse<{ idps: IdpRow[] }>>(
|
|
`/org/${params.orgId}/idp`,
|
|
await authCookieHeader()
|
|
);
|
|
idps = res.data.data.idps;
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
|
|
const t = await getTranslations();
|
|
|
|
return (
|
|
<>
|
|
<SettingsSectionTitle
|
|
title={t("idpManage")}
|
|
description={t("idpManageDescription")}
|
|
/>
|
|
|
|
<IdpGlobalModeBanner />
|
|
|
|
<PaidFeaturesAlert tiers={tierMatrix.orgOidc} />
|
|
|
|
<IdpTable idps={idps} orgId={params.orgId} />
|
|
</>
|
|
);
|
|
}
|