mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 02:52:43 +00:00
refactor(onboard): unify auth-choice aliases and provider flags
This commit is contained in:
28
src/commands/auth-choice-legacy.ts
Normal file
28
src/commands/auth-choice-legacy.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { AuthChoice } from "./onboard-types.js";
|
||||
|
||||
export const AUTH_CHOICE_LEGACY_ALIASES_FOR_CLI: ReadonlyArray<AuthChoice> = [
|
||||
"setup-token",
|
||||
"oauth",
|
||||
"claude-cli",
|
||||
"codex-cli",
|
||||
"minimax-cloud",
|
||||
"minimax",
|
||||
];
|
||||
|
||||
export function normalizeLegacyOnboardAuthChoice(
|
||||
authChoice: AuthChoice | undefined,
|
||||
): AuthChoice | undefined {
|
||||
if (authChoice === "oauth" || authChoice === "claude-cli") {
|
||||
return "setup-token";
|
||||
}
|
||||
if (authChoice === "codex-cli") {
|
||||
return "openai-codex";
|
||||
}
|
||||
return authChoice;
|
||||
}
|
||||
|
||||
export function isDeprecatedAuthChoice(
|
||||
authChoice: AuthChoice | undefined,
|
||||
): authChoice is "claude-cli" | "codex-cli" {
|
||||
return authChoice === "claude-cli" || authChoice === "codex-cli";
|
||||
}
|
||||
Reference in New Issue
Block a user