Skip to content

Compute refresh token expiry using the time it was issued and the current TTL - #781

Open
dowski wants to merge 1 commit into
dowski/cap-max-sessionsfrom
dowski/compute-refresh-token-expiry
Open

dowski wants to merge 1 commit into
dowski/cap-max-sessionsfrom
dowski/compute-refresh-token-expiry

Conversation

@dowski

@dowski dowski commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

This simplifies the schema and the behavior. With the old model, a previously issued refresh token could outlast a token issued under an updated (shortened) TTL. Now a presented token is compared against the current TTL and newly issued tokens will always last longer than previously issued ones.

This is a schema breaking change: refreshTokens.expiresAt is removed, so clear the auth/refreshTokens and auth/sessions tables before updating.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
auth-v2 Ready Ready Preview Oct 28, 2026 8:43pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
convex-auth-docs Ignored Ignored Oct 28, 2026 8:43pm UTC

Request Review

dowski commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/@convex-dev/auth@781

commit: a712847

@dowski
dowski force-pushed the dowski/compute-refresh-token-expiry branch from 2691f47 to 3f654c4 Compare October 23, 2026 21:15
@dowski
dowski force-pushed the dowski/cap-max-sessions branch from 966cbc9 to 061f061 Compare October 23, 2026 21:15
@dowski
dowski force-pushed the dowski/compute-refresh-token-expiry branch from 3f654c4 to 5658f9e Compare October 26, 2026 23:27
@dowski
dowski force-pushed the dowski/cap-max-sessions branch from 061f061 to 9aa3f57 Compare October 26, 2026 23:27
@dowski
dowski force-pushed the dowski/cap-max-sessions branch from 9aa3f57 to 7b4cb69 Compare October 26, 2026 23:44
@dowski
dowski force-pushed the dowski/compute-refresh-token-expiry branch from 5658f9e to c0c444a Compare October 26, 2026 23:44
@dowski
dowski force-pushed the dowski/cap-max-sessions branch from 7b4cb69 to d77819b Compare October 26, 2026 23:53
@dowski
dowski force-pushed the dowski/compute-refresh-token-expiry branch from c0c444a to af785e7 Compare October 26, 2026 23:53
@dowski
dowski force-pushed the dowski/compute-refresh-token-expiry branch from af785e7 to 82f3d10 Compare October 27, 2026 14:51
@dowski
dowski force-pushed the dowski/cap-max-sessions branch from d77819b to 50c7ed3 Compare October 27, 2026 14:51

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 7 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/core/src/server/setup.ts">

<violation number="1" location="packages/core/src/server/setup.ts:215">
P3: This new refresh-token description conflicts with the function-level documentation above, which still says TTL changes affect only newly minted tokens. Update the function-level text to distinguish access-token changes from refresh-token changes so generated API docs do not publish contradictory expiry behavior.</violation>
</file>

Comment thread packages/core/src/server/setup.ts
…rent TTL

This simplifies the schema and the behavior. With the old model, a previously issued refresh token could outlast a token issued under an updated (shortened) TTL. Now a presented token is compared against the current TTL and newly issued tokens will always last longer than previously issued ones.

This branch was successfully deployed

1 active deployment
Preview – auth-v2 — a712847b Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant