diff --git a/lib/crates/fabro-cli/src/commands/install.rs b/lib/crates/fabro-cli/src/commands/install.rs index 808018f4e..29fdf6e96 100644 --- a/lib/crates/fabro-cli/src/commands/install.rs +++ b/lib/crates/fabro-cli/src/commands/install.rs @@ -2300,7 +2300,7 @@ client_id = "client-id" .iter() .map(|value| value.as_str().expect("auth method should be a string")) .collect::>(), - vec!["dev-token", "github"] + vec!["github"] ); let allowed_usernames = doc diff --git a/lib/crates/fabro-install/src/lib.rs b/lib/crates/fabro-install/src/lib.rs index e13415561..2e9302f6f 100644 --- a/lib/crates/fabro-install/src/lib.rs +++ b/lib/crates/fabro-install/src/lib.rs @@ -215,6 +215,7 @@ pub fn write_github_app_settings( if !methods.iter().any(|value| value.as_str() == Some("github")) { methods.push(toml::Value::String("github".to_string())); } + methods.retain(|value| value.as_str() != Some("dev-token")); let github_auth = ensure_table(auth, "github")?; github_auth.insert( "allowed_usernames".to_string(), @@ -438,6 +439,22 @@ name = "custom" github.get("client_id").and_then(toml::Value::as_str), Some("client-id") ); + + let methods = doc + .get("server") + .and_then(toml::Value::as_table) + .and_then(|server| server.get("auth")) + .and_then(toml::Value::as_table) + .and_then(|auth| auth.get("methods")) + .and_then(toml::Value::as_array) + .expect("server.auth.methods should exist"); + assert_eq!( + methods + .iter() + .map(|value| value.as_str().expect("auth method should be a string")) + .collect::>(), + vec!["github"] + ); } #[test]