add client secret option

This commit is contained in:
crondinini-ant 2025-10-10 18:21:34 +01:00
commit bc1ca95aea
No known key found for this signature in database

View file

@ -67,6 +67,7 @@ interface UseConnectionOptions {
// Custom headers support
customHeaders?: CustomHeaders;
oauthClientId?: string;
oauthClientSecret?: string;
oauthScope?: string;
config: InspectorConfig;
connectionType?: "direct" | "proxy";
@ -89,6 +90,7 @@ export function useConnection({
env,
customHeaders,
oauthClientId,
oauthClientSecret,
oauthScope,
config,
connectionType = "proxy",
@ -125,12 +127,20 @@ export function useConnection({
return;
}
const clientInformation: { client_id: string; client_secret?: string } = {
client_id: oauthClientId,
};
if (oauthClientSecret) {
clientInformation.client_secret = oauthClientSecret;
}
saveClientInformationToSessionStorage({
serverUrl: sseUrl,
clientInformation: { client_id: oauthClientId },
clientInformation,
isPreregistered: true,
});
}, [oauthClientId, sseUrl]);
}, [oauthClientId, oauthClientSecret, sseUrl]);
const pushHistory = (request: object, response?: object) => {
setRequestHistory((prev) => [