mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 08:14:45 +00:00
fix(cursor): deprecate legacy bridge and harden gitlab auth
This commit is contained in:
1 parent
93afdb50bf
commit
87d93b651b
13 files changed
+334
-95
No files matched your search
@@ -69,6 +69,7 @@ import {
|
||||
warnPossible403Ban,
|
||||
} from '../account-safety';
|
||||
import { ensureCliAntigravityResponsibility } from '../antigravity-responsibility';
|
||||
import { InteractivePrompt } from '../../utils/prompt';
|
||||
|
||||
interface PasteCallbackStartData {
|
||||
url?: string;
|
||||
@@ -153,20 +154,21 @@ function normalizeGitLabBaseUrl(baseUrl: string | undefined): string | undefined
|
||||
return normalized ? normalized : undefined;
|
||||
}
|
||||
|
||||
async function promptGitLabPersonalAccessToken(): Promise<string | null> {
|
||||
const readline = await import('readline');
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
return new Promise<string | null>((resolve) => {
|
||||
rl.question('GitLab Personal Access Token: ', (answer) => {
|
||||
rl.close();
|
||||
const token = answer.trim();
|
||||
resolve(token.length > 0 ? token : null);
|
||||
});
|
||||
});
|
||||
export async function promptGitLabPersonalAccessToken(): Promise<string | null> {
|
||||
try {
|
||||
const token = (await InteractivePrompt.password('GitLab Personal Access Token')).trim();
|
||||
return token.length > 0 ? token : null;
|
||||
} catch (error) {
|
||||
if ((error as Error).message.includes('TTY')) {
|
||||
console.log(
|
||||
fail(
|
||||
'GitLab Personal Access Token prompt requires an interactive TTY. Set the token explicitly or use Browser OAuth.'
|
||||
)
|
||||
);
|
||||
return null;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export function findNewTokenSnapshotForManualAuth(
|
||||
|
||||
Reference in new issue
Block a user