2021-10-29 16:11:06 +00:00
|
|
|
import { lazy } from "react";
|
2023-01-18 12:09:49 +00:00
|
|
|
import type { Path } from "react-router-dom";
|
|
|
|
import { generatePath } from "react-router-dom";
|
2023-03-27 14:10:48 +00:00
|
|
|
import type { AppRouteObject } from "../../routes";
|
2021-07-21 15:08:40 +00:00
|
|
|
|
|
|
|
export type CreateInitialAccessTokenParams = { realm: string };
|
|
|
|
|
2023-03-24 14:37:24 +00:00
|
|
|
const CreateInitialAccessToken = lazy(
|
|
|
|
() => import("../initial-access/CreateInitialAccessToken")
|
|
|
|
);
|
|
|
|
|
2023-03-27 14:10:48 +00:00
|
|
|
export const CreateInitialAccessTokenRoute: AppRouteObject = {
|
2021-07-21 15:08:40 +00:00
|
|
|
path: "/:realm/clients/initialAccessToken/create",
|
2023-03-24 14:37:24 +00:00
|
|
|
element: <CreateInitialAccessToken />,
|
2021-07-21 15:08:40 +00:00
|
|
|
breadcrumb: (t) => t("clients:createToken"),
|
2023-03-27 00:31:23 +00:00
|
|
|
handle: {
|
|
|
|
access: "manage-clients",
|
|
|
|
},
|
2021-07-21 15:08:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const toCreateInitialAccessToken = (
|
|
|
|
params: CreateInitialAccessTokenParams
|
2022-08-19 18:05:09 +00:00
|
|
|
): Partial<Path> => ({
|
2021-07-21 15:08:40 +00:00
|
|
|
pathname: generatePath(CreateInitialAccessTokenRoute.path, params),
|
|
|
|
});
|