fix(expo): support anthropic_oauth_json auth type in provider form
The backend aiProviderProfiles authType union added 'anthropic_oauth_json' but the Expo provider form's local AuthType type was stale, breaking typecheck. Add the literal, a picker option, help text, and multiline handling to match the Next app. Claude-Session: https://claude.ai/code/session_01ScyZ1NhfN84LAnHpwhfEQk
This commit is contained in:
@@ -20,7 +20,11 @@ type Provider =
|
||||
| 'cloudflare_ai_gateway'
|
||||
| 'custom_openai_compatible'
|
||||
| 'opencode_openai_login';
|
||||
type AuthType = 'api_key' | 'opencode_auth_json' | 'none';
|
||||
type AuthType =
|
||||
| 'api_key'
|
||||
| 'opencode_auth_json'
|
||||
| 'anthropic_oauth_json'
|
||||
| 'none';
|
||||
type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
||||
|
||||
type ExistingProfile = {
|
||||
@@ -174,6 +178,7 @@ export const AiProviderProfileForm = ({
|
||||
options={[
|
||||
{ label: 'API key', value: 'api_key' },
|
||||
{ label: 'Codex auth JSON', value: 'opencode_auth_json' },
|
||||
{ label: 'Anthropic OAuth JSON', value: 'anthropic_oauth_json' },
|
||||
{ label: 'None', value: 'none' },
|
||||
]}
|
||||
value={authType}
|
||||
@@ -186,10 +191,20 @@ export const AiProviderProfileForm = ({
|
||||
agent workspaces for Codex CLI runs.
|
||||
</Text>
|
||||
) : null}
|
||||
{authType === 'anthropic_oauth_json' ? (
|
||||
<Text className='text-muted-foreground text-sm leading-5'>
|
||||
Paste the credentials JSON from your Claude auth folder, for example
|
||||
~/.claude/.credentials.json, and paste it here. Spoon writes it into
|
||||
isolated agent workspaces for Claude Code CLI runs.
|
||||
</Text>
|
||||
) : null}
|
||||
{authType !== 'none' ? (
|
||||
<Field
|
||||
label={authType === 'api_key' ? 'API key' : 'Auth JSON'}
|
||||
multiline={authType === 'opencode_auth_json'}
|
||||
multiline={
|
||||
authType === 'opencode_auth_json' ||
|
||||
authType === 'anthropic_oauth_json'
|
||||
}
|
||||
secureTextEntry={authType === 'api_key'}
|
||||
value={secret}
|
||||
onChangeText={setSecret}
|
||||
|
||||
Reference in New Issue
Block a user