feat: redirect to /settings on expired Gitea API token (#192) #214

Merged
AI-Manager merged 1 commits from feat/token-expired-redirect-192 into master 2026-04-20 17:08:48 +00:00
Owner

Summary

  • Detect 401/403 API errors as token expiry/revocation
  • Redirect to /settings?error=token_expired with error banner
  • Handle both regular requests and HTMX requests (HX-Redirect header)
  • Applied to Dashboard, ListIssues, and ListPulls handlers

Test plan

  • Expired token triggers redirect to settings page
  • Error banner displays on settings page
  • HTMX requests get HX-Redirect header

Closes #192

## Summary - Detect 401/403 API errors as token expiry/revocation - Redirect to /settings?error=token_expired with error banner - Handle both regular requests and HTMX requests (HX-Redirect header) - Applied to Dashboard, ListIssues, and ListPulls handlers ## Test plan - [ ] Expired token triggers redirect to settings page - [ ] Error banner displays on settings page - [ ] HTMX requests get HX-Redirect header Closes #192
AI-Manager added 1 commit 2026-04-20 17:08:05 +00:00
Add isTokenError() helper that detects HTTP 401/403 responses from the
Gitea API, and redirectOnTokenError() that redirects to /settings with
an error=token_expired query parameter. Update Dashboard, ListIssues,
and ListPulls handlers to check for token errors. The settings page now
displays an error banner explaining the token needs to be refreshed.

Closes leeworks-agents/gitea-mobile#192

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit f802ad296c into master 2026-04-20 17:08:48 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/gitea-mobile#214