mirror of
https://github.com/fosrl/pangolin.git
synced 2026-04-01 07:26:38 +00:00
32 lines
905 B
TypeScript
32 lines
905 B
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/AdminIdpTable";
|
|
import { getTranslations } from "next-intl/server";
|
|
|
|
export default async function IdpPage() {
|
|
let idps: IdpRow[] = [];
|
|
try {
|
|
const res = await internal.get<AxiosResponse<{ idps: IdpRow[] }>>(
|
|
`/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")}
|
|
/>
|
|
<IdpTable idps={idps} />
|
|
</>
|
|
);
|
|
}
|