diff --git a/src/api/useCqlLibraryServiceApi.tsx b/src/api/useCqlLibraryServiceApi.tsx index b011950..9fe0eff 100644 --- a/src/api/useCqlLibraryServiceApi.tsx +++ b/src/api/useCqlLibraryServiceApi.tsx @@ -3,7 +3,7 @@ import useServiceConfig from "./useServiceConfig"; import { ServiceConfig } from "./ServiceContext"; import { CqlLibrary } from "@madie/madie-models"; import useOktaTokens from "../hooks/useOktaTokens"; - +import { wafIntercept } from "@madie/madie-util"; export class CqlLibraryServiceApi { constructor(private baseUrl: string, private getAccessToken: () => string) {} @@ -101,6 +101,10 @@ export class CqlLibraryServiceApi { } } +axios.interceptors.response.use((response) => { + return response; +}, wafIntercept); + export default function useCqlLibraryServiceApi() { const serviceConfig: ServiceConfig = useServiceConfig(); const { getAccessToken } = useOktaTokens(); diff --git a/src/components/config/useGetServiceConfig.ts b/src/components/config/useGetServiceConfig.ts index f0e5154..03e94fa 100644 --- a/src/components/config/useGetServiceConfig.ts +++ b/src/components/config/useGetServiceConfig.ts @@ -1,6 +1,6 @@ import axios from "axios"; import { useEffect, useState } from "react"; - +import { wafIntercept } from "@madie/madie-util"; export interface OktaConfig { baseUrl: string; issuer: string; @@ -23,6 +23,10 @@ export interface ServiceConfig { }; } +axios.interceptors.response.use((response) => { + return response; +}, wafIntercept); + const useGetServiceConfig = () => { const [config, setConfig] = useState(null); const [error, setError] = useState(null); diff --git a/src/types/madie-madie-util.d.ts b/src/types/madie-madie-util.d.ts index 8fde3c9..ecc5fa2 100644 --- a/src/types/madie-madie-util.d.ts +++ b/src/types/madie-madie-util.d.ts @@ -87,6 +87,8 @@ declare module "@madie/madie-util" { draft?: boolean ): boolean; + export function wafIntercept(): void; + export const bootstrap: LifeCycleFn; export const mount: LifeCycleFn; export const unmount: LifeCycleFn;