From beeb85e15bc4a307d70fdf67656603cac9917d94 Mon Sep 17 00:00:00 2001 From: hoelee Date: Fri, 28 Aug 2026 14:50:00 +0800 Subject: [PATCH] feat(shell-sync): log_oauth_authorization_guidance --- platform/shell-sync/sync.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/platform/shell-sync/sync.sh b/platform/shell-sync/sync.sh index 6d3ab803..86ef43de 100644 --- a/platform/shell-sync/sync.sh +++ b/platform/shell-sync/sync.sh @@ -42,3 +42,14 @@ oauth_authorization_invalid() { 'invalid_grant|expired.*(token|credential)|token.*expired|refresh token.*(expired|revoked|invalid)|authorization.*(expired|revoked)|AADSTS700082|AADSTS700084|AUTHENTICATE failed|authentication.*failed|authentication unsuccessful|invalid credentials' } +log_oauth_authorization_guidance() { + local i="$1" + local provider="$2" + local logfile="$3" + + if oauth_authorization_invalid "$logfile"; then + log "Account $i: OAuth2 authorization is expired, revoked, or rejected by $provider. Reauthorize with: docker compose run --rm imapsync authorize $i" + log "Account $i: After reauthorization, run immediately with: docker compose exec imapsync sync.sh sync $i" + fi +} +