Option to regenerate Newt keys

This commit is contained in:
Pallavi Kumari
2025-10-26 21:00:46 +05:30
parent 42091e88cb
commit d32505a833
13 changed files with 491 additions and 41 deletions

View File

@@ -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>

View File

@@ -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`
}
];