File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,6 @@ export const clearClientInformationFromSessionStorage = ({
66
66
} ;
67
67
68
68
export class InspectorOAuthClientProvider implements OAuthClientProvider {
69
-
70
69
constructor ( protected serverUrl : string ) {
71
70
// Save the server URL to session storage
72
71
sessionStorage . setItem ( SESSION_KEYS . SERVER_URL , serverUrl ) ;
@@ -89,10 +88,11 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
89
88
90
89
async clientInformation ( ) {
91
90
// Try to get the preregistered client information from session storage first
92
- const preregisteredClientInformation = await getClientInformationFromSessionStorage ( {
93
- serverUrl : this . serverUrl ,
94
- isPreregistered : true ,
95
- } ) ;
91
+ const preregisteredClientInformation =
92
+ await getClientInformationFromSessionStorage ( {
93
+ serverUrl : this . serverUrl ,
94
+ isPreregistered : true ,
95
+ } ) ;
96
96
97
97
// If no preregistered client information is found, get the dynamically registered client information
98
98
return (
Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ import { z } from "zod";
36
36
import { ConnectionStatus } from "../constants" ;
37
37
import { Notification , StdErrNotificationSchema } from "../notificationTypes" ;
38
38
import { auth } from "@modelcontextprotocol/sdk/client/auth.js" ;
39
- import { clearClientInformationFromSessionStorage , InspectorOAuthClientProvider , saveClientInformationToSessionStorage } from "../auth" ;
39
+ import {
40
+ clearClientInformationFromSessionStorage ,
41
+ InspectorOAuthClientProvider ,
42
+ saveClientInformationToSessionStorage ,
43
+ } from "../auth" ;
40
44
import packageJson from "../../../package.json" ;
41
45
import {
42
46
getMCPProxyAddress ,
@@ -297,9 +301,7 @@ export function useConnection({
297
301
298
302
const handleAuthError = async ( error : unknown ) => {
299
303
if ( is401Error ( error ) ) {
300
- const serverAuthProvider = new InspectorOAuthClientProvider (
301
- sseUrl ,
302
- ) ;
304
+ const serverAuthProvider = new InspectorOAuthClientProvider ( sseUrl ) ;
303
305
304
306
const result = await auth ( serverAuthProvider , {
305
307
serverUrl : sseUrl ,
You can’t perform that action at this time.
0 commit comments