Merge pull request #715 from modelcontextprotocol/fweinberger/fix-sensitive-local-storage

fweinberger/fix sensitive local storage
This commit is contained in:
Cliff Hall 2025-08-14 13:23:44 -04:00 • committed by GitHub
commit c5047ca30a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,10 +110,17 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
} }
saveClientInformation(clientInformation: OAuthClientInformation) { saveClientInformation(clientInformation: OAuthClientInformation) {
// Remove client_secret before storing (not needed after initial OAuth flow)
const safeInfo = Object.fromEntries(
Object.entries(clientInformation).filter(
([key]) => key !== "client_secret",
),
) as OAuthClientInformation;
// Save the dynamically registered client information to session storage // Save the dynamically registered client information to session storage
saveClientInformationToSessionStorage({ saveClientInformationToSessionStorage({
serverUrl: this.serverUrl, serverUrl: this.serverUrl,
clientInformation, clientInformation: safeInfo,
isPreregistered: false, isPreregistered: false,
}); });
} }