1.6.1
⚙️ Patch 1.6.1 — Google token refresh resiliency and frontend force-refresh¶
🚀 Summary¶
- Small operational patch: handle Google OAuth
invalid_grantrefresh failures gracefully and force-refresh client cache for Google credentials.
✨ Improvements¶
- Backend:
- Gracefully handle Google
invalid_granterrors during token refresh by returning aTokenRefreshResponsethat includesneeds_reauth: trueand anauth_urlplaceholder, instead of returning HTTP 400. This lets the frontend prompt for re-authorization without noisy errors. - Added defensive handling around token refresh in the Google endpoints across
service_invoice,service_plenty,service_omni, andservice_jtl. -
Extended the
TokenRefreshResponsemodel withauth_urlandneeds_reauthfields to avoid schema mismatches with the frontend. -
Frontend:
- The credentials "Refresh" action now forces a server fetch (bypassing local cache) to surface the latest credential state after re-authorization or auto-refresh attempts.
- Auto-refresh flow treats a refresh response containing
auth_urlas a signal that manual re-authorization is required, and surfaces the auth dialog.
🐛 Bug Fixes¶
- Fix a bug where token refresh failures caused the backend to raise HTTP 400 errors for
invalid_grant, which prevented the frontend from handling re-authorization flows automatically. - Fix UI inconsistency where the refresh button could return stale results due to cached credentials.
📁 Files changed¶
- docs/docs/patchnotes/1.6/1.6.1.md (this file)
- backend/service_invoice/app/api/v1/endpoints/google.py
- backend/service_invoice/app/models/google.py
- backend/service_plenty/app/api/v1/endpoints/google.py
- backend/service_plenty/app/models/google.py
- backend/service_omni/app/api/v1/endpoints/google.py
- backend/service_omni/app/models/google.py
- backend/service_jtl/app/api/v1/endpoints/google.py
- backend/service_jtl/app/models/google.py
- frontend/src/pages/Invoices/Credentials/GoogleCredentials.jsx
- frontend/src/pages/Statistics/Credentials/GoogleCredentials.jsx
- frontend/src/pages/JtlServices/Credentials/GoogleCredentials.jsx
- frontend/src/pages/Plenty/Credentials/GoogleCredentials.jsx