Add puppeteer dependency and suppress hydration warnings in various c…#70
Merged
sphildreth merged 1 commit intomainfrom Mar 22, 2026
Merged
Add puppeteer dependency and suppress hydration warnings in various c…#70sphildreth merged 1 commit intomainfrom
sphildreth merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates authentication/UI behavior and dev tooling in the Narravo Next.js codebase, focusing on reducing noisy logs, improving hydration stability, and adding a browser automation dependency.
Changes:
- Add
puppeteertodevDependenciesand updatepnpm-lock.yamlaccordingly. - Improve 2FA/WebAuthn environment handling and trusted-device behavior during JWT creation.
- Suppress hydration warnings for server/client date rendering mismatches and remove verbose 2FA console logging.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lib/auth.ts | Switches 2FA login behavior to respect a trusted-device cookie when setting mfaPending/mfa. |
| src/lib/2fa/webauthn.ts | Expands origin resolution to support AUTH_URL, legacy NEXTAUTH_URL, and Vercel environment variables. |
| src/components/posts/PostCard.tsx | Suppresses hydration warnings for formatted date rendering. |
| src/components/comments/CommentNode.tsx | Suppresses hydration warnings for localized timestamp rendering. |
| src/components/auth/TwoFactorVerification.tsx | Removes debug console.log statements from 2FA verification flows. |
| src/components/auth/TwoFactorGuard.tsx | Removes debug logging from redirect guard logic. |
| src/components/ArticleCard.tsx | Suppresses hydration warnings for formatted date rendering. |
| src/components/admin/ModerationQueue.tsx | Suppresses hydration warnings for localized “Created” timestamp rendering. |
| package.json | Adds puppeteer to dev tooling dependencies. |
| pnpm-lock.yaml | Lockfile updates for puppeteer and transitive dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| "drizzle-kit": "0.31.10", | ||
| "eslint": "10.1.0", | ||
| "eslint-config-next": "16.2.1", | ||
| "puppeteer": "^24.40.0", |
There was a problem hiding this comment.
puppeteer is added to devDependencies, but there are no in-repo imports or scripts referencing it (Playwright is already present, and LHCI typically uses puppeteer-core). If this isn’t immediately required, consider removing it (or documenting/adding the script that uses it) to avoid extra install time and the Chromium download footprint in CI/dev.
Suggested change
| "puppeteer": "^24.40.0", |
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.
This pull request primarily adds the
puppeteerpackage as a new dependency and cleans up unnecessary console logging in authentication-related React components. It also makes minor improvements to hydration warnings in the UI. The most important changes are grouped below:Dependency Management:
puppeteer(v24.40.0) as a dependency inpackage.jsonand updatedpnpm-lock.yamlto includepuppeteerand its transitive dependencies, such ascosmiconfig,js-yaml,parse-json, and others. This enables browser automation and end-to-end testing capabilities. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]UI Hydration Improvements:
suppressHydrationWarningto date display elements inArticleCard.tsxandModerationQueue.tsxto prevent React hydration mismatches on client/server rendering. [1] [2]Code Cleanup (Authentication Components):
console.logdebugging statements fromTwoFactorGuard.tsxandTwoFactorVerification.tsx, resulting in cleaner production code and improved security by not logging sensitive authentication flow details. [1] [2] [3] [4]