Repository navigation
chore(web): correct stale and redundant comments in auth and signup modules - #9253
Conversation
Comment-only cleanup of five files. The TypeScript printer output of each
file is identical before and after, so no behavior changes.
- device-sessions: drop the stale "returns null with an error code" line;
rotateRefreshToken returns a discriminated union whose failure arm is
`{ ok: false, error }`.
- native-admission: remove the keyId label that named only iOS assertion
while the check requires it for attestation too, and remove three
labels that restate the conditions below them. The payload label stays.
- email-signin-eligibility: stop enumerating sign-in paths in the
checkDomainSignInEligibility doc; the native passkey branch also calls
the shared core, so the invariant is stated without a list.
- blacklist-domains-config: describe only the TLDs
DEFAULT_BLOCKED_SIGNUP_TLDS holds.
- user/server: drop the comment that restates the isNewUser assignment.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change is comment-only and fixes the lone prior finding: the Assumptions: Files Reviewed (1 changed in this pass)
Previously reviewed, unchanged
Previous Review Summary (commit a18f136)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit a18f136)Status: 1 Issue Found | Recommendation: Address before merge Overview
Executive SummaryThe change is comment-only and every correction matches the current source, except one stale cross-reference path that survived the Assumptions: Issue Details (click to expand)SUGGESTION
Files Reviewed (5 files)
Reviewed by deepseek-flash-latest · Input: 24K · Output: 1.5K · Cached: 163.2K Review guidance: REVIEW.md from base branch |
The checkDomainSignInEligibility doc named lib/user/server.ts as the file holding the mirrored inline checks. Those checks live in the signIn callback of lib/user/next-auth-options.ts, so the reference now names that file. Comment-only.
Evidence
Evidence: demonstrated — the stale claims were checked against the source on
mainand corrected in place, and the change is proven comment-only: for each of the five touched files, the TypeScript printer output (comments removed) is byte-identical before and after, so no code, type or behavior changes. The affected suites pass unchanged:apps/webJestdevice-sessions,native-admission,email-signin-eligibilitypluspackages/web-sharedblacklist-domains-configanduser/server(5 suites, 205 tests), andscripts/typecheck-all.sh --changes-onlyreports the affected packages clean. Both touched areas are comment-only library code with no runtime surface of its own, so there is no separate UI or API path to drive; the suites exercise the functions the comments describe.Each item and the source that established it:
rotateRefreshTokenreturned nonull: its signature is a discriminated union ending in{ ok: false; error: 'INVALID_REFRESH_TOKEN' | 'SESSION_REVOKED' | 'USER_BLOCKED' }, and every failure path returns that arm. The "returns null" sentence is gone.validateAdmissionPayloadrejects an iOS payload withoutkeyIdfor bothattestationandassertion, matching the type's own field doc; the label that named only assertion is removed, so the requirement is stated once (inline at the iOS check and on the field).payloadlabel stays because base64 encoding is not visible from a non-empty-string check.checkDomainSignInEligibilitydoc listed sign-in paths but missed the passkey branch ofapp/api/auth/native/token/route.ts, which also calls it; the doc now states the invariant without an enumeration that goes stale. The same paragraph now points atlib/user/next-auth-options.tsfor the mirrored inline checks, which is where thesignIncallback lives.DEFAULT_BLOCKED_SIGNUP_TLDSdocuments only.shopand.top, which is what the array holds and what the env fallback returns.session.isNewUserassignment while the sibling assignments carry none; removed, and the neighboringisAdmincomment that documents the|| falseinvariant is kept.Production prerequisites
None.
Proxy answers
The owner's proxy gave these answers in the owner's place.
// keyId: optional string (required for iOS assertion)and contradicts the iOS check at 180-182 (keyId required for attestation and assertion) and the type doc at 107. The finding's recommendation is to delete the line; the work-item brief says to correct it to say both iOS kinds, and the inline comment at 181 (// iOS requires keyId for both attestation and assertion) would then say the same thing twice. How should line 175 be handled?Answer: Delete line 175
Confidence: 0.66 · Precedent: Speed and least work: 'do the least amount of work possible, with no drop in quality' (session 7f3470e0ba6f). The brief's goal is to remove stale and restating comments, and the comment at 181 and the type doc at 107 already state the correct requirement.