From ed413ee02937fa317beca1446d493adbb92abecb Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Wed, 30 Oct 2024 16:13:20 +0000 Subject: [PATCH] fix: saved credentials not working --- crates/gpapi/src/credential.rs | 6 +----- crates/gpapi/src/portal/config.rs | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/gpapi/src/credential.rs b/crates/gpapi/src/credential.rs index 2438764..acae63e 100644 --- a/crates/gpapi/src/credential.rs +++ b/crates/gpapi/src/credential.rs @@ -196,11 +196,7 @@ impl Credential { ), // Use the empty string as the password if auth_cookie is present Credential::Cached(cred) => ( - if cred.auth_cookie.is_some() { - None - } else { - cred.password() - }, + cred.password(), None, cred.auth_cookie.as_ref().map(|c| c.user_auth_cookie()), cred.auth_cookie.as_ref().map(|c| c.prelogon_user_auth_cookie()), diff --git a/crates/gpapi/src/portal/config.rs b/crates/gpapi/src/portal/config.rs index f775d57..3db25d6 100644 --- a/crates/gpapi/src/portal/config.rs +++ b/crates/gpapi/src/portal/config.rs @@ -153,7 +153,9 @@ pub async fn retrieve_config(portal: &str, cred: &Credential, gp_params: &GpPara }); let user_auth_cookie = root.descendant_text("portal-userauthcookie").unwrap_or_default(); - let prelogon_user_auth_cookie = root.descendant_text("portal-prelogonuserauthcookie").unwrap_or_default(); + let prelogon_user_auth_cookie = root + .descendant_text("portal-prelogonuserauthcookie") + .unwrap_or_default(); let config_digest = root.descendant_text("config-digest"); if gateways.is_empty() {