Demo: a static copy of one review, without the review service. Reviewed marks apply in this tab until it reloads, and view settings stay in this browser. Comments, decisions, and publication need an installed mcp-review. About mcp-review · Get early access

Snapshot #2 of 2

Snapshot #1 → #2: the earlier snapshot's code against the displayed snapshot.

Harden sign-in: hashed passwords, expiring sessions and per-session rate limits

Coverage

Presentation
All 143 selected changes are placed. 132 in groups · 0 unbucketed · 4 generated · 7 without a text diff
Explanations
13 of 13 groups have an explanation.
Agent analysis
Reading the analysis status…
Human review
7 of 136 hunks are marked reviewed.

Outdated discussions 1

These discussions have no verified location in the displayed changes. Each keeps its original code and stays open to replies and resolution.

OPEN src/auth.ts Outdated · Ln 27 This token is the user name and the time of the request, so anyone who knows roughly when a user refreshed can guess it. Should it be random, like the session I…
src/auth.ts · new side · Ln 27

The selected new-side lines no longer exist in src/auth.ts.

  session.token = `tok-${session.user}-${Date.now()}`;
You

This token is the user name and the time of the request, so anyone who knows roughly when a user refreshed can guess it. Should it be random, like the session ID in createSession?

Review agent

Yes. The next snapshot sets the token with crypto.randomUUID(), as createSession does for the session ID, so the token no longer depends on the user name or the clock.

Session store

Session creation requires a user, expiry uses createdAt, rotation happens on use, and the browser hook keeps the token fresh.

The session SQL lives in src/db/queries.ts, whose remaining hunks belong to Database & migrations.

src/session-utils.ts
+0 -60

The changes load when the file comes near.

src/api/middleware/auth.ts
+8 -28

The changes load when the file comes near.

src/db/queries.ts
+20 -11

The changes load when the file comes near.

src/ui/hooks/useLegacySession.ts
+0 -60

The changes load when the file comes near.

src/ui/hooks/useSession.ts
+48 -31

The changes load when the file comes near.

+3,567 -1,767 left