From 4b26267f5c3e49029bc9fb7047ee4af59ff8515b Mon Sep 17 00:00:00 2001 From: Steven Enamakel <31011319+senamakel@users.noreply.github.com> Date: Sun, 31 May 2026 22:54:36 -0700 Subject: [PATCH] fix(auth): gracefully drop OAuth profiles with missing access_token (#3125) --- src/openhuman/credentials/profiles.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/openhuman/credentials/profiles.rs b/src/openhuman/credentials/profiles.rs index ae4671c07..18f3cfe18 100644 --- a/src/openhuman/credentials/profiles.rs +++ b/src/openhuman/credentials/profiles.rs @@ -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,