From ca8b76df5789a176ce12bc3eaab4657f19c2189e Mon Sep 17 00:00:00 2001 From: hoelee Date: Wed, 20 May 2026 09:00:00 +0800 Subject: [PATCH] feat(shell-sync): add oauth_authorization_invalid() --- platform/shell-sync/sync.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/shell-sync/sync.sh b/platform/shell-sync/sync.sh index cab80dda..6d3ab803 100644 --- a/platform/shell-sync/sync.sh +++ b/platform/shell-sync/sync.sh @@ -36,3 +36,9 @@ get_var() { echo "${!varname:-}" } +oauth_authorization_invalid() { + local logfile="$1" + tail -n 200 "$logfile" 2>/dev/null | grep -Eqi \ + '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' +} +