mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 19:45:34 +08:00
fix(gemini): write security auth config only to Gemini settings file
- Remove redundant security.auth.selectedType from CC Switch settings - Fix Generic provider type not writing security flag on switch - All non-Google Official providers now correctly write "gemini-api-key" - Delete unused ensure_packycode_security_flag function - Clean up SecuritySettings and SecurityAuthSettings types from AppSettings
This commit is contained in:
@@ -15,8 +15,7 @@ use crate::services::mcp::McpService;
|
||||
use crate::store::AppState;
|
||||
|
||||
use super::gemini_auth::{
|
||||
detect_gemini_auth_type, ensure_google_oauth_security_flag, ensure_packycode_security_flag,
|
||||
GeminiAuthType,
|
||||
detect_gemini_auth_type, ensure_google_oauth_security_flag, GeminiAuthType,
|
||||
};
|
||||
use super::normalize_claude_models_in_value;
|
||||
|
||||
@@ -375,10 +374,14 @@ pub(crate) fn write_gemini_live(provider: &Provider) -> Result<(), AppError> {
|
||||
write_json_file(&settings_path, &config_value)?;
|
||||
}
|
||||
|
||||
// Set security.auth.selectedType based on auth type
|
||||
// - Google Official: OAuth mode
|
||||
// - All others: API Key mode
|
||||
match auth_type {
|
||||
GeminiAuthType::GoogleOfficial => ensure_google_oauth_security_flag(provider)?,
|
||||
GeminiAuthType::Packycode => ensure_packycode_security_flag(provider)?,
|
||||
GeminiAuthType::Generic => {}
|
||||
GeminiAuthType::Packycode | GeminiAuthType::Generic => {
|
||||
crate::gemini_config::write_packycode_settings()?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user