feat: oidc poc

This commit is contained in:
Sheen Capadngan
2024-06-17 20:32:47 +08:00
parent 2d8a2a6a3a
commit 66e5edcfc0
19 changed files with 512 additions and 3 deletions
@@ -0,0 +1 @@
export * from "./queries";
@@ -0,0 +1,19 @@
import { useQuery } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
export const oidcConfigKeys = {
getOIDCConfig: (orgSlug: string) => [{ orgSlug }, "organization-oidc"] as const
};
export const useGetOIDCConfig = (orgSlug: string) => {
return useQuery({
queryKey: oidcConfigKeys.getOIDCConfig(orgSlug),
queryFn: async () => {
const { data } = await apiRequest.get(`/api/v1/oidc/config?orgSlug=${orgSlug}`);
return data;
},
enabled: true
});
};