Skip to content

feat: track and display device token expiry in admin UI#2369

Open
dirkwa wants to merge 4 commits intoSignalK:masterfrom
dirkwa:feat-device-token-expiry
Open

feat: track and display device token expiry in admin UI#2369
dirkwa wants to merge 4 commits intoSignalK:masterfrom
dirkwa:feat-device-token-expiry

Conversation

@dirkwa
Copy link
Contributor

@dirkwa dirkwa commented Feb 25, 2026

Summary

  • Store JWT exp claim as tokenExpiry on device records when approving access requests
  • Display token expiry status in the R19 Devices page (table column + detail view) showing remaining time or an "Expired" badge
  • Show badge counts on the Security sidebar menu: red for expired device tokens, green for pending access requests
  • Fix Form.Control type="select" → Form.Select in AccessRequests to resolve React 19 error Handle error in certificate creation #137

Tested

  • Approve a device access request with a short expiration (e.g. 60s) and verify tokenExpiry appears in the Devices table
  • Verify expired tokens show a red "Expired" badge in both the table and detail view
  • Verify the Security sidebar item shows a red badge for expired devices and a green badge for pending access requests
  • Verify badges on the Security parent hide when the dropdown is expanded (children show their own)
  • Verify the AccessRequests permissions dropdown works without React error Handle error in certificate creation #137

Images

Screenshot 2026-02-26 041006 Screenshot 2026-02-26 040808

Store the JWT exp claim as tokenExpiry when approving device access
requests, making it available via the devices API for admin UI display.
Add Token Expiry column to the devices table and detail view showing
remaining time or an Expired badge. Fetch devices via the store so
the sidebar can also access device data.
Show a red badge on the Security menu item for expired device tokens
and a green badge for pending access requests. Hide parent badges
when the dropdown is expanded since children show their own.
Replace Form.Control type="select" with Form.Select to avoid React 19
error SignalK#137 (void element with children). Default expiration to 1y.
Copy link
Member

@tkurki tkurki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbender9 how does this look to you?

I often dislike human oriented time expressions and yearn for the exact time when something has happened / will happen. How about showing that on hover? Tiny detail, I know...

Another point would be to have "last seen" timestamp for tokens. Expiry is one thing, but last seen is often more valuable. Trouble is that would need persistence, and I don't want to complicate things with something like that right now, as I think we should start using node:sqlite and skserver.sqlite for stuff like this. So maybe file that for later, or another PR...

@tkurki tkurki added the feature label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants