mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-04 20:05:38 +08:00
refactor: move provider auth status management to custom hook
This commit is contained in:
@@ -1,16 +1,5 @@
|
||||
import type { CliProvider, ProviderStatusMap } from './types';
|
||||
|
||||
export const cliProviders: CliProvider[] = ['claude', 'cursor', 'codex', 'gemini'];
|
||||
|
||||
export const gitEmailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
export const createInitialProviderStatuses = (): ProviderStatusMap => ({
|
||||
claude: { authenticated: false, email: null, loading: true, error: null },
|
||||
cursor: { authenticated: false, email: null, loading: true, error: null },
|
||||
codex: { authenticated: false, email: null, loading: true, error: null },
|
||||
gemini: { authenticated: false, email: null, loading: true, error: null },
|
||||
});
|
||||
|
||||
export const readErrorMessageFromResponse = async (response: Response, fallback: string) => {
|
||||
try {
|
||||
const payload = (await response.json()) as { error?: string };
|
||||
|
||||
Reference in New Issue
Block a user