fix: refresh terminal websocket auth on reconnect #32

Merged
jimmy merged 1 commits from dev into main 2026-03-07 17:57:48 +08:00
Owner

Summary

  • refresh terminal websocket auth before opening websocket connections during reconnects
  • reuse the existing frontend token refresh flow instead of retrying stale access tokens
  • stop terminal reconnect loops when refresh can no longer recover auth and show a clear re-login message

Test plan

  • Run cd dashboard/frontend && npm run build
  • Log into the dashboard and confirm terminal connects normally
  • Simulate a transient disconnect with a still-valid refresh token and confirm the terminal reconnects automatically
  • Simulate an expired access token with a valid refresh token and confirm reconnect succeeds without a full reload
  • Simulate expired access and refresh tokens and confirm reconnect stops with a clear auth error
  • Confirm normal REST API auth behavior is unchanged

🤖 Generated with Claude Code

## Summary - refresh terminal websocket auth before opening websocket connections during reconnects - reuse the existing frontend token refresh flow instead of retrying stale access tokens - stop terminal reconnect loops when refresh can no longer recover auth and show a clear re-login message ## Test plan - [x] Run `cd dashboard/frontend && npm run build` - [ ] Log into the dashboard and confirm terminal connects normally - [ ] Simulate a transient disconnect with a still-valid refresh token and confirm the terminal reconnects automatically - [ ] Simulate an expired access token with a valid refresh token and confirm reconnect succeeds without a full reload - [ ] Simulate expired access and refresh tokens and confirm reconnect stops with a clear auth error - [ ] Confirm normal REST API auth behavior is unchanged 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jimmy added 1 commit 2026-03-07 17:57:33 +08:00
fix: refresh terminal websocket auth on reconnect
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 3m16s
e72665c466
Reuse the existing refresh-token flow before opening terminal websocket connections so reconnects can recover from expired access tokens without requiring a full dashboard reload.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jimmy merged commit 1e5b32060e into main 2026-03-07 17:57:48 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jimmy/nas-tools#32