Add "revoked by landlord" state to /sign/[token] expired screen#4
Open
keywise-app wants to merge 3 commits into
Open
Add "revoked by landlord" state to /sign/[token] expired screen#4keywise-app wants to merge 3 commits into
keywise-app wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal: Add "revoked by landlord" state to /sign/[token] expired screen
Severity: medium · Route: /sign/[token]
What I changed
app/api/sign-document/route.ts(GET handler): Replaced the singlestatus === 410branch with two ordered checks:tokenRow.revoked_atis set → return{ reason: 'revoked' }with 410expires_atis in the past → return{ reason: 'expired' }with 410The
revoked_atfield check is additive — if the column doesn't yet exist on the DB row it simply evaluates falsy and falls through to the TTL check, so there's no regression on existing tokens.app/sign/[token]/page.tsx: Added'revoked'to the state union type. In thestatus === 410handler, the frontend now readsdata.reasonand routes to eithersetState('revoked')orsetState('expired'). Added a newstate === 'revoked'render block with 🚫 icon and the closure copy from the proposal.Files touched
app/api/sign-document/route.ts— surfacereasonfield ("revoked"|"expired") in 410 responseapp/sign/[token]/page.tsx— addrevokedstate, branch ondata.reasonin 410 handler, render distinct UI cardNotes
revoked_atcolumn is read optimistically — no migration required for the frontend to be ready. When the migration addingrevoked_attosigning_tokensships (separate human-reviewed migration), the revoked state will activate automatically.