This commit is contained in:
seb
2026-10-12 22:32:21 +02:00
parent 28e62093b3
commit 8a8aeaedd7
21 changed files with 786 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
import { CONSUME_AUTH_CODE as MSSQL_CONSUME } from '../../providers/mssql/queries/mcp.js';
import { CONSUME_AUTH_CODE as SQLITE_CONSUME } from '../../providers/sqlite3/queries/mcp.js';
export default function consumeAuthCode(provider) {
const sql = provider.dialect === 'sqlite3' ? SQLITE_CONSUME : MSSQL_CONSUME;
/**
* Marks an authorization code as used.
*
* @param {string} code - The authorization code to mark used.
* @returns {Promise<boolean>} True once marked.
*/
return async (code) => {
await provider.query(sql, { code });
return true;
};
}