mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 22:33:08 +00:00
Merge remote-tracking branch 'upstream/v0.15.0rc' into refactor/auto-mode-service-gsxdsm
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import type { Request, Response } from 'express';
|
||||
import { query } from '@anthropic-ai/claude-agent-sdk';
|
||||
import { createLogger } from '@automaker/utils';
|
||||
import { getClaudeAuthIndicators } from '@automaker/platform';
|
||||
import { getApiKey } from '../common.js';
|
||||
import {
|
||||
createSecureAuthEnv,
|
||||
@@ -320,9 +321,28 @@ export function createVerifyClaudeAuthHandler() {
|
||||
authMethod,
|
||||
});
|
||||
|
||||
// Determine specific auth type for success messages
|
||||
const effectiveAuthMethod = authMethod ?? 'api_key';
|
||||
let authType: 'oauth' | 'api_key' | 'cli' | undefined;
|
||||
if (authenticated) {
|
||||
if (effectiveAuthMethod === 'api_key') {
|
||||
authType = 'api_key';
|
||||
} else if (effectiveAuthMethod === 'cli') {
|
||||
// Check if CLI auth is via OAuth (Claude Code subscription) or generic CLI
|
||||
try {
|
||||
const indicators = await getClaudeAuthIndicators();
|
||||
authType = indicators.credentials?.hasOAuthToken ? 'oauth' : 'cli';
|
||||
} catch {
|
||||
// Fall back to generic CLI if credential check fails
|
||||
authType = 'cli';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
authenticated,
|
||||
authType,
|
||||
error: errorMessage || undefined,
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user