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.

Tests

The tests of the production sections above, in the same order: login and hashing, sessions, the HTTP API, rate limiting and the database queries, then the end-to-end passes over the form and the retired fakes.

tests/auth.test.ts
+34 -12

The changes load when the file comes near.

tests/crypto.test.ts
+25 -0

The changes load when the file comes near.

tests/legacy.test.ts
+0 -18

The changes load when the file comes near.

tests/middleware.test.ts
+46 -6

The changes load when the file comes near.

tests/rateLimit.test.ts
+23 -0

The changes load when the file comes near.

tests/router.test.ts
+31 -11

The changes load when the file comes near.

tests/session.test.ts
+25 -8

The changes load when the file comes near.

tests/db/queries.test.ts
+41 -6

The changes load when the file comes near.

tests/e2e/login.spec.ts
+22 -0

The changes load when the file comes near.

tests/e2e/rateLimit.spec.ts
+19 -0

The changes load when the file comes near.

tests/e2e/sessions.spec.ts
+26 -0

The changes load when the file comes near.

tests/helpers/oldFakes.ts
+0 -43

The changes load when the file comes near.

tests/legacy/tokens.test.ts
+0 -65

The changes load when the file comes near.

+3,567 -1,767 left