fix wizard serialization issues

This commit is contained in:
Clément DOUIN
2024-01-12 10:16:43 +01:00
parent a15e2c0442
commit 1246be8a5b
8 changed files with 383 additions and 37 deletions
+7 -5
View File
@@ -135,6 +135,8 @@ pub(crate) async fn configure(account_name: &str, email: &str) -> Result<Backend
let auth = if oauth2_enabled {
let mut config = OAuth2Config::default();
let redirect_host = OAuth2Config::LOCALHOST;
let redirect_port = OAuth2Config::get_first_available_port()?;
let method_idx = Select::with_theme(&*THEME)
.with_prompt("SMTP OAuth 2.0 mechanism")
@@ -245,13 +247,13 @@ pub(crate) async fn configure(account_name: &str, email: &str) -> Result<Backend
config.auth_url.clone(),
config.token_url.clone(),
)?
.with_redirect_host(config.redirect_host.clone())
.with_redirect_port(config.redirect_port)
.with_redirect_host(redirect_host.to_owned())
.with_redirect_port(redirect_port)
.build()?;
let mut auth_code_grant = AuthorizationCodeGrant::new()
.with_redirect_host(config.redirect_host.clone())
.with_redirect_port(config.redirect_port);
.with_redirect_host(redirect_host.to_owned())
.with_redirect_port(redirect_port);
if config.pkce {
auth_code_grant = auth_code_grant.with_pkce();
@@ -312,7 +314,7 @@ pub(crate) async fn configure(account_name: &str, email: &str) -> Result<Backend
_ => Default::default(),
};
SmtpAuthConfig::Passwd(PasswdConfig { passwd: secret })
SmtpAuthConfig::Passwd(PasswdConfig(secret))
};
let config = SmtpConfig {