mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-07 19:26:36 +00:00
Option to regenerate Newt keys
This commit is contained in:
@@ -74,24 +74,24 @@ export default function CredentialsPage() {
|
||||
setLoading(true);
|
||||
|
||||
try {
|
||||
await api.post(`/client/${client?.clientId}`, {
|
||||
await api.post(`/client/${client?.clientId}/regenerate-secret`, {
|
||||
olmId: clientDefaults?.olmId,
|
||||
secret: clientDefaults?.olmSecret,
|
||||
});
|
||||
|
||||
toast({
|
||||
title: t("clientUpdated"),
|
||||
description: t("clientUpdatedDescription")
|
||||
title: t("credentialsSaved"),
|
||||
description: t("credentialsSavedDescription")
|
||||
});
|
||||
|
||||
router.refresh();
|
||||
} catch (e) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: t("clientUpdateFailed"),
|
||||
title: t("credentialsSaveError"),
|
||||
description: formatAxiosError(
|
||||
e,
|
||||
t("clientUpdateError")
|
||||
t("credentialsSaveErrorDescription")
|
||||
)
|
||||
});
|
||||
} finally {
|
||||
@@ -107,7 +107,7 @@ export default function CredentialsPage() {
|
||||
{t("generatedcredentials")}
|
||||
</SettingsSectionTitle>
|
||||
<SettingsSectionDescription>
|
||||
{t("regenerateClientCredentials")}
|
||||
{t("regenerateCredentials")}
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import ClientInfoCard from "../../../../../components/ClientInfoCard";
|
||||
import ClientProvider from "@app/providers/ClientProvider";
|
||||
import { redirect } from "next/navigation";
|
||||
import { HorizontalTabs } from "@app/components/HorizontalTabs";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
type SettingsLayoutProps = {
|
||||
children: React.ReactNode;
|
||||
@@ -30,13 +31,15 @@ export default async function SettingsLayout(props: SettingsLayoutProps) {
|
||||
redirect(`/${params.orgId}/settings/clients`);
|
||||
}
|
||||
|
||||
const t = await getTranslations();
|
||||
|
||||
const navItems = [
|
||||
{
|
||||
title: "General",
|
||||
title: t('general'),
|
||||
href: `/{orgId}/settings/clients/{clientId}/general`
|
||||
},
|
||||
{
|
||||
title: "Credentials",
|
||||
title: t('credentials'),
|
||||
href: `/{orgId}/settings/clients/{clientId}/credentials`
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user