Skip to content

Conversation

@slhck
Copy link
Contributor

@slhck slhck commented Nov 21, 2025

When token refresh fails (e.g., invalid_scope, revoked token), the server now catches the exception and automatically triggers OAuth reauthentication instead of crashing during startup.

Changes:

  • Wrap creds.refresh() in try-except block to catch refresh failures
  • Automatically fall back to OAuth flow when refresh fails
  • Save refreshed tokens to disk when refresh succeeds
  • Add logging to indicate refresh attempts and failures

Fixes the issue where expired/invalid tokens cause server startup to fail with an unhandled google.auth.exceptions.RefreshError.

🤖 Generated with Claude Code

When token refresh fails (e.g., invalid_scope, revoked token), the server
now catches the exception and automatically triggers OAuth reauthentication
instead of crashing during startup.

Changes:
- Wrap creds.refresh() in try-except block to catch refresh failures
- Automatically fall back to OAuth flow when refresh fails
- Save refreshed tokens to disk when refresh succeeds
- Add logging to indicate refresh attempts and failures

Fixes the issue where expired/invalid tokens cause server startup to fail
with an unhandled google.auth.exceptions.RefreshError.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@xing5
Copy link
Owner

xing5 commented Nov 25, 2025

Thanks for the fix!

@xing5 xing5 merged commit 07470d6 into xing5:main Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants