fix(auth): gracefully drop OAuth profiles with missing access_token (#3125)

This commit is contained in:
Steven Enamakel
2026-05-31 22:54:36 -07:00
committed by GitHub
parent ceb769aecc
commit 4b26267f5c
+12 -3
View File
@@ -682,9 +682,18 @@ impl AuthProfilesStore {
};
let token_set = match kind {
AuthProfileKind::OAuth => {
let access = access_token.ok_or_else(|| {
anyhow::anyhow!("OAuth profile missing access_token: {id}")
})?;
let access = match access_token {
Some(a) => a,
None => {
log::warn!(
"[auth] dropping OAuth profile with missing access_token: \
provider={}. Re-authenticate to restore.",
p.provider
);
dropped_ids.push(id.clone());
continue;
}
};
Some(TokenSet {
access_token: access,
refresh_token,