Refresh token UI to use GQL#1990
Conversation
d60c562 to
4db5bdd
Compare
Resyncs the generated GraphQL types with the live schema after rebasing onto main. Drops the service-account schema (ApiKeyInfo, ServiceAccount, createServiceAccount, revokeApiKey, serviceAccounts, the ManageServiceAccounts capability bit, TenantFilter) that an earlier codegen run had incidentally captured, and removes validFor from the RefreshTokenInfo output type and the RefreshTokens query, which the server no longer exposes.
96f4766 to
2329fe9
Compare
jshearer
left a comment
There was a problem hiding this comment.
Got some almost entirely 🤖🦾 review feedback for ya
|
|
||
| const result = await revokeRefreshToken({ id }); | ||
|
|
||
| if (result.error) { |
There was a problem hiding this comment.
Does this ever return false? I kind of doubt it...
revokeRefreshToken is typed Boolean! and the schema documents "already-zeroed (revoked) tokens are treated as not found", but revokeToken only branches on result.error and never reads result.data?.revokeRefreshToken. If the not-found path returns false with no GraphQL error, the dialog reports success on a no-op (e.g. revoking a token already revoked elsewhere). This is partly inherited from the old PATCH-based flow and the cache invalidation makes the end state roughly correct, so it's low impact, but checking the boolean alongside result.error is the defensive fix. Confirming requires the resolver's not-found contract (returns Ok(false) vs raises an error).
There was a problem hiding this comment.
oh yeah - it can technically return false if you revoke and already-revoked token, but all we care about in this case is whether the request succeeds (i.e. the user's intent either came true ...or already was true)
jshearer
left a comment
There was a problem hiding this comment.
Once you address the above review feedback this should be good to go 👍
- Gate create dialog dismissal on the in-flight create state so backdrop/Escape can't close mid-request and orphan the new token's secret - Realign table headers with their cells: add a Uses header and move Status over the expired column - Suppress the empty-state message on load error so it no longer renders beneath the error banner - Recover from an empty non-first page with a useEffect (mirrors AccessLinksTable) instead of the row-level page-back heuristic, and drop the now-unused onRevoked prop; revoke marks a token expired rather than removing it, so a revoke never empties the page
Summary
Migrates the refresh token UI from PostgREST to GraphQL.
Test plan