feat: add NocoBase browser OAuth login

This commit is contained in:
nac
2026-08-18 04:08:27 +00:00
parent 5c2cbac5b1
commit 4c53f90947
16 changed files with 1138 additions and 143 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import { VERSION } from "../src/version.js";
test("package, manifest, and runtime versions agree with no runtime npm dependencies", () => {
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
const manifest = JSON.parse(readFileSync(new URL("../install-manifest.json", import.meta.url), "utf8"));
assert.equal(VERSION, "0.3.1");
assert.equal(VERSION, "0.4.0");
assert.equal(packageJson.version, VERSION);
assert.equal(manifest.version, VERSION);
assert.deepEqual(packageJson.dependencies, undefined);
@@ -24,14 +24,14 @@ test("generated MCP config contains no Key, token, or environment secret", () =>
assert.doesNotMatch(serialized, /authorize|token|secret|password/i);
});
test("setup refuses a non-TTY before creating credential files", async () => {
test("manual Key fallback refuses a non-TTY before creating credential files", async () => {
if (process.stdin.isTTY || process.stderr.isTTY) return;
const directory = mkdtempSync(join(tmpdir(), "nocobase-mcp-nontty-"));
const path = join(directory, "credentials.json");
const previous = process.env.NOCOBASE_MCP_CREDENTIALS;
process.env.NOCOBASE_MCP_CREDENTIALS = path;
try {
await assert.rejects(runCli(["setup", "--json"]), /local terminal/);
await assert.rejects(runCli(["setup", "--manual-key", "--json"]), /local terminal/);
assert.equal(existsSync(path), false);
assert.equal(existsSync(join(directory, "config.json")), false);
} finally {