chore: fix lint issue
This commit is contained in:
parent
1c9b47a0e8
commit
ee39d56e6d
2 changed files with 11 additions and 9 deletions
|
|
@ -66,7 +66,6 @@ export const clearClientInformationFromSessionStorage = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
export class InspectorOAuthClientProvider implements OAuthClientProvider {
|
export class InspectorOAuthClientProvider implements OAuthClientProvider {
|
||||||
|
|
||||||
constructor(protected serverUrl: string) {
|
constructor(protected serverUrl: string) {
|
||||||
// Save the server URL to session storage
|
// Save the server URL to session storage
|
||||||
sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
|
sessionStorage.setItem(SESSION_KEYS.SERVER_URL, serverUrl);
|
||||||
|
|
@ -89,10 +88,11 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
|
||||||
|
|
||||||
async clientInformation() {
|
async clientInformation() {
|
||||||
// Try to get the preregistered client information from session storage first
|
// Try to get the preregistered client information from session storage first
|
||||||
const preregisteredClientInformation = await getClientInformationFromSessionStorage({
|
const preregisteredClientInformation =
|
||||||
serverUrl: this.serverUrl,
|
await getClientInformationFromSessionStorage({
|
||||||
isPreregistered: true,
|
serverUrl: this.serverUrl,
|
||||||
});
|
isPreregistered: true,
|
||||||
|
});
|
||||||
|
|
||||||
// If no preregistered client information is found, get the dynamically registered client information
|
// If no preregistered client information is found, get the dynamically registered client information
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,11 @@ import { z } from "zod";
|
||||||
import { ConnectionStatus } from "../constants";
|
import { ConnectionStatus } from "../constants";
|
||||||
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
|
import { Notification, StdErrNotificationSchema } from "../notificationTypes";
|
||||||
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
import { auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
||||||
import { clearClientInformationFromSessionStorage, InspectorOAuthClientProvider, saveClientInformationToSessionStorage } from "../auth";
|
import {
|
||||||
|
clearClientInformationFromSessionStorage,
|
||||||
|
InspectorOAuthClientProvider,
|
||||||
|
saveClientInformationToSessionStorage,
|
||||||
|
} from "../auth";
|
||||||
import packageJson from "../../../package.json";
|
import packageJson from "../../../package.json";
|
||||||
import {
|
import {
|
||||||
getMCPProxyAddress,
|
getMCPProxyAddress,
|
||||||
|
|
@ -297,9 +301,7 @@ export function useConnection({
|
||||||
|
|
||||||
const handleAuthError = async (error: unknown) => {
|
const handleAuthError = async (error: unknown) => {
|
||||||
if (is401Error(error)) {
|
if (is401Error(error)) {
|
||||||
const serverAuthProvider = new InspectorOAuthClientProvider(
|
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
|
||||||
sseUrl,
|
|
||||||
);
|
|
||||||
|
|
||||||
const result = await auth(serverAuthProvider, {
|
const result = await auth(serverAuthProvider, {
|
||||||
serverUrl: sseUrl,
|
serverUrl: sseUrl,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue