feat(settings/components): introduce password input for API key to enhance security

This commit is contained in:
kangfenmao 2024-07-19 13:38:44 +08:00
parent 93a5739d87
commit c4394b925d

View File

@ -75,13 +75,14 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
<Divider style={{ width: '100%', margin: '10px 0' }} />
<SettingSubtitle style={{ marginTop: 5 }}>{t('settings.provider.api_key')}</SettingSubtitle>
<Space.Compact style={{ width: '100%' }}>
<Input
<Input.Password
value={apiKey}
placeholder={t('settings.provider.api_key')}
onChange={(e) => setApiKey(e.target.value)}
onBlur={onUpdateApiKey}
spellCheck={false}
disabled={apiKeyDisabled}
type="password"
autoFocus={provider.enabled && apiKey === ''}
/>
{!apiKeyDisabled && (