mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:01:22 +00:00
fix(auth): strip line breaks from pasted keys
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
resolveAuthProfileOrder,
|
||||
} from "../../agents/auth-profiles.js";
|
||||
import { resolveEnvApiKey } from "../../agents/model-auth.js";
|
||||
import { normalizeOptionalSecretInput } from "../../utils/normalize-secret-input.js";
|
||||
|
||||
export type NonInteractiveApiKeySource = "flag" | "env" | "profile";
|
||||
|
||||
@@ -48,7 +49,7 @@ export async function resolveNonInteractiveApiKey(params: {
|
||||
agentDir?: string;
|
||||
allowProfile?: boolean;
|
||||
}): Promise<{ key: string; source: NonInteractiveApiKeySource } | null> {
|
||||
const flagKey = params.flagValue?.trim();
|
||||
const flagKey = normalizeOptionalSecretInput(params.flagValue);
|
||||
if (flagKey) {
|
||||
return { key: flagKey, source: "flag" };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user