fix(gpclient): honor the requested username when reusing cookies (#732)

This commit is contained in:
Kevin Yue authored and GitHub committed 2026-11-30 20:05:21 +08:00
1 parent 69155d04b9
commit fe3125ec61
3 files changed
+65 -8

No files matched your search

+2 -2
View File
@@ -83,7 +83,7 @@ impl ConnectHandler<'_> {
pub(super) async fn try_cached_cookie(&self, server: &str) -> Option<anyhow::Result<()>> {
let path = cookie_cache_path(self.args)?;
let host_id = self.os_profile.borrow().host_identity().host_id().to_string();
let stored = cookie_store::load(&path, server, &host_id)?;
let stored = cookie_store::load(&path, server, &host_id, self.args.user.as_deref())?;
if !stored.auth_cookie.can_authenticate_gateway() {
cookie_store::clear(&path);
return None;
@@ -145,7 +145,7 @@ impl ConnectHandler<'_> {
}
let path = cookie_cache_path(self.args)?;
let host_id = self.os_profile.borrow().host_identity().host_id().to_string();
let stored = cookie_store::load(&path, server, &host_id)?;
let stored = cookie_store::load(&path, server, &host_id, self.args.user.as_deref())?;
if !stored.auth_cookie.can_authenticate_gateway() {
cookie_store::clear(&path);
return None;