mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-14 10:27:24 +00:00
fix: replace getDatabase with better-sqlite3 db in getGithubTokenById (#501)
This commit is contained in:
@@ -311,13 +311,11 @@ router.post('/create-workspace', async (req, res) => {
|
|||||||
* Helper function to get GitHub token from database
|
* Helper function to get GitHub token from database
|
||||||
*/
|
*/
|
||||||
async function getGithubTokenById(tokenId, userId) {
|
async function getGithubTokenById(tokenId, userId) {
|
||||||
const { getDatabase } = await import('../database/db.js');
|
const { db } = await import('../database/db.js');
|
||||||
const db = await getDatabase();
|
|
||||||
|
|
||||||
const credential = await db.get(
|
const credential = db.prepare(
|
||||||
'SELECT * FROM user_credentials WHERE id = ? AND user_id = ? AND credential_type = ? AND is_active = 1',
|
'SELECT * FROM user_credentials WHERE id = ? AND user_id = ? AND credential_type = ? AND is_active = 1'
|
||||||
[tokenId, userId, 'github_token']
|
).get(tokenId, userId, 'github_token');
|
||||||
);
|
|
||||||
|
|
||||||
// Return in the expected format (github_token field for compatibility)
|
// Return in the expected format (github_token field for compatibility)
|
||||||
if (credential) {
|
if (credential) {
|
||||||
|
|||||||
Reference in New Issue
Block a user