Linting
This commit is contained in:
@@ -25,9 +25,14 @@ const OAuthCallback = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await auth(authProvider, { serverUrl, authorizationCode: code });
|
const result = await auth(authProvider, {
|
||||||
|
serverUrl,
|
||||||
|
authorizationCode: code,
|
||||||
|
});
|
||||||
if (result !== "AUTHORIZED") {
|
if (result !== "AUTHORIZED") {
|
||||||
throw new Error(`Expected to be authorized after providing auth code, got: ${result}`);
|
throw new Error(
|
||||||
|
`Expected to be authorized after providing auth code, got: ${result}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect back to the main app with server URL to trigger auto-connect
|
// Redirect back to the main app with server URL to trigger auto-connect
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
import { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
||||||
import { OAuthClientInformationSchema, OAuthClientInformation, OAuthTokens, OAuthTokensSchema } from "@modelcontextprotocol/sdk/shared/auth.js";
|
import {
|
||||||
|
OAuthClientInformationSchema,
|
||||||
|
OAuthClientInformation,
|
||||||
|
OAuthTokens,
|
||||||
|
OAuthTokensSchema,
|
||||||
|
} from "@modelcontextprotocol/sdk/shared/auth.js";
|
||||||
import { SESSION_KEYS } from "./constants";
|
import { SESSION_KEYS } from "./constants";
|
||||||
|
|
||||||
class InspectorOAuthClientProvider implements OAuthClientProvider {
|
class InspectorOAuthClientProvider implements OAuthClientProvider {
|
||||||
@@ -44,10 +49,7 @@ class InspectorOAuthClientProvider implements OAuthClientProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveTokens(tokens: OAuthTokens) {
|
saveTokens(tokens: OAuthTokens) {
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(SESSION_KEYS.TOKENS, JSON.stringify(tokens));
|
||||||
SESSION_KEYS.TOKENS,
|
|
||||||
JSON.stringify(tokens),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectToAuthorization(authorizationUrl: URL) {
|
redirectToAuthorization(authorizationUrl: URL) {
|
||||||
@@ -55,10 +57,7 @@ class InspectorOAuthClientProvider implements OAuthClientProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveCodeVerifier(codeVerifier: string) {
|
saveCodeVerifier(codeVerifier: string) {
|
||||||
sessionStorage.setItem(
|
sessionStorage.setItem(SESSION_KEYS.CODE_VERIFIER, codeVerifier);
|
||||||
SESSION_KEYS.CODE_VERIFIER,
|
|
||||||
codeVerifier,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
codeVerifier() {
|
codeVerifier() {
|
||||||
|
|||||||
Reference in New Issue
Block a user