File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ async function ensureAuthenticated() {
7575
7676 console . error ( '[codeant-mcp] No API token configured — opening browser for sign-in.' ) ;
7777 try {
78- const { loginUrl } = await runLoginFlow ( ) ;
79- console . error ( ` [codeant-mcp] Login complete. (URL was ${ loginUrl } )` ) ;
78+ await runLoginFlow ( ) ;
79+ console . error ( ' [codeant-mcp] Login complete.' ) ;
8080 } catch ( err ) {
8181 console . error ( `[codeant-mcp] Login failed: ${ err . message } . The server will start anyway; call the codeant_login tool to retry.` ) ;
8282 }
@@ -404,7 +404,8 @@ export async function startMcpServer() {
404404 } ,
405405 async ( { force } ) => {
406406 try {
407- if ( ! force && isAlreadyLoggedIn ( ) ) {
407+ const envToken = process . env . CODEANT_API_TOKEN ;
408+ if ( ! force && ( ( envToken && envToken . trim ( ) ) || isAlreadyLoggedIn ( ) ) ) {
408409 return ok ( { alreadyLoggedIn : true } ) ;
409410 }
410411 const { token, loginUrl } = await runLoginFlow ( ) ;
You can’t perform that action at this time.
0 commit comments