refactor: use CraftTable naming in OAuth client
This commit is contained in:
Vendored
+4
-4
@@ -505,7 +505,7 @@ var OAuthCallbackServer = class {
|
||||
|
||||
// src/oauthProvider.ts
|
||||
import { randomBytes, timingSafeEqual } from "node:crypto";
|
||||
var GameCraftOAuthProvider = class {
|
||||
var CraftTableOAuthProvider = class {
|
||||
constructor(options, tokenStore, discoveryStore, onRedirect, state = randomBytes(32).toString("base64url")) {
|
||||
this.options = options;
|
||||
this.tokenStore = tokenStore;
|
||||
@@ -577,7 +577,7 @@ var GameCraftOAuthProvider = class {
|
||||
async function connectRemote(options, tokenStore, discoveryStore, serviceToken = process.env.CRAFTTABLE_MCP_TOKEN?.trim()) {
|
||||
const tokens = await tokenStore.get(credentialAccount(options));
|
||||
if (tokens) {
|
||||
const provider = new GameCraftOAuthProvider(options, tokenStore, discoveryStore, () => {
|
||||
const provider = new CraftTableOAuthProvider(options, tokenStore, discoveryStore, () => {
|
||||
throw new Error("OAuth login is required; run `crafttable-mcp login`");
|
||||
});
|
||||
return connectWithTransport(options, new StreamableHTTPClientTransport(options.url, { authProvider: provider }), "oauth");
|
||||
@@ -594,7 +594,7 @@ async function loginRemote(options, tokenStore, discoveryStore, input = { browse
|
||||
`));
|
||||
await requireOAuthProtectedResourceMetadata(options.url);
|
||||
let authorizationUrl;
|
||||
const provider = new GameCraftOAuthProvider(options, tokenStore, discoveryStore, async (url) => {
|
||||
const provider = new CraftTableOAuthProvider(options, tokenStore, discoveryStore, async (url) => {
|
||||
authorizationUrl = url;
|
||||
if (!input.browser) {
|
||||
writeLine(`Open this URL to log in:
|
||||
@@ -603,7 +603,7 @@ ${url.toString()}`);
|
||||
}
|
||||
try {
|
||||
await open(url.toString(), { wait: false });
|
||||
writeLine("Opened the system browser for Game-CraftTable login.");
|
||||
writeLine("Opened the system browser for CraftTable login.");
|
||||
} catch (error) {
|
||||
writeLine(`Could not open the browser (${errorMessage(error)}). Open this URL manually:
|
||||
${url.toString()}`);
|
||||
|
||||
Reference in New Issue
Block a user