move re-key API routes to private api

This commit is contained in:
Pallavi Kumari
2025-11-08 02:43:47 +05:30
parent 8a5f59cb9f
commit b6e98632b5
15 changed files with 75 additions and 41 deletions

View File

@@ -59,7 +59,7 @@ export default function CredentialsPage() {
setCredentials(data);
await api.put<AxiosResponse<QuickStartRemoteExitNodeResponse>>(
`/org/${orgId}/reGenerate-remote-exit-node-secret`,
`/re-key/${orgId}/reGenerate-remote-exit-node-secret`,
{
remoteExitNodeId: remoteExitNode.remoteExitNodeId,
secret: data.secret,

View File

@@ -52,7 +52,7 @@ export default function CredentialsPage() {
const data = res.data.data;
setClientDefaults(data);
await api.post(`/client/${client?.clientId}/regenerate-secret`, {
await api.post(`/re-key/${client?.clientId}/regenerate-client-secret`, {
olmId: data.olmId,
secret: data.olmSecret,
});

View File

@@ -8,6 +8,7 @@ import ClientProvider from "@app/providers/ClientProvider";
import { redirect } from "next/navigation";
import { HorizontalTabs } from "@app/components/HorizontalTabs";
import { getTranslations } from "next-intl/server";
import { build } from "@server/build";
type SettingsLayoutProps = {
children: React.ReactNode;
@@ -38,10 +39,13 @@ export default async function SettingsLayout(props: SettingsLayoutProps) {
title: t('general'),
href: `/{orgId}/settings/clients/{clientId}/general`
},
{
title: t('credentials'),
href: `/{orgId}/settings/clients/{clientId}/credentials`
}
...(build === 'enterprise'
? [{
title: t('credentials'),
href: `/{orgId}/settings/clients/{clientId}/credentials`
},
]
: []),
];
return (

View File

@@ -95,7 +95,7 @@ PersistentKeepalive = 5`;
);
}
await api.post(`/site/${site?.siteId}/regenerate-secret`, {
await api.post(`/re-key/${site?.siteId}/regenerate-site-secret`, {
type: "wireguard",
subnet: res.data.data.subnet,
exitNodeId: res.data.data.exitNodeId,
@@ -109,7 +109,7 @@ PersistentKeepalive = 5`;
const data = res.data.data;
setSiteDefaults(data);
await api.post(`/site/${site?.siteId}/regenerate-secret`, {
await api.post(`/re-key/${site?.siteId}/regenerate-site-secret`, {
type: "newt",
newtId: data.newtId,
newtSecret: data.newtSecret

View File

@@ -8,6 +8,7 @@ import { HorizontalTabs } from "@app/components/HorizontalTabs";
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import SiteInfoCard from "../../../../../components/SiteInfoCard";
import { getTranslations } from "next-intl/server";
import { build } from "@server/build";
interface SettingsLayoutProps {
children: React.ReactNode;
@@ -37,7 +38,7 @@ export default async function SettingsLayout(props: SettingsLayoutProps) {
title: t('general'),
href: `/${params.orgId}/settings/sites/${params.niceId}/general`,
},
...(site.type !== 'local'
...(site.type !== 'local' && build === 'enterprise'
? [
{
title: t('credentials'),