Repository navigation
Test new doc - #563
Test new doc#563
Conversation
WalkthroughReintroduced Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
6b09404 to
639e2c7
Compare
| // UI Components - Framework-specific | ||
| 'auth-components-nextjs': 'core-concepts/authentication/ui-components/nextjs.mdx', | ||
| 'auth-components-react': 'core-concepts/authentication/ui-components/react.mdx', | ||
| 'auth-components-nextjs': 'core-concepts/authentication/ui-components/nextjs.mdx', |
There was a problem hiding this comment.
is mcp right now needing to read all 3?
There was a problem hiding this comment.
For now, it's good to let MCP read all of them just to make things work.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
docs/core-concepts/authentication/ui-components/react-router.mdx (2)
62-65: Minor: Markdown hyphenation for readability.Lines 62–65 use "sign in" and "sign out" as two words in the bullet-list descriptions. For consistency and readability in parameter documentation, consider using hyphens: "sign-in" and "sign-out".
This is a minor style preference and can be deferred if your documentation guidelines differ.
- `afterSignInUrl` (required): Redirect URL after successful sign in (default: `'/'`) - `onSignIn` (optional): Custom function to sync token on sign in - `onSignOut` (optional): Custom function to clear auth state on sign out + `afterSignInUrl` (required): Redirect URL after successful sign-in (default: `'/'`) + `onSignIn` (optional): Custom function to sync token on sign-in + `onSignOut` (optional): Custom function to clear auth state on sign-out
450-453: Minor: Hyphenation for parameter descriptions (optional).Line 452 describes "Redirect URL after sign out". For consistency, consider "after sign-out" to match parameter naming conventions (e.g.,
afterSignOutUrl).- `afterSignOutUrl` - Redirect URL after sign out + `afterSignOutUrl` - Redirect URL after sign-outdocs/core-concepts/authentication/ui-components/react.mdx (2)
139-165: Path-based routing approach is workable but has limitations.The refactored App component now uses
window.location.pathnamefor routing instead of React Router. While this simplifies the example and works for basic use cases, it has drawbacks:
- No history API integration: Browser back/forward buttons won't work correctly.
- Manual redirects: Line 158 uses
window.location.href, causing full-page reloads instead of smooth client-side navigation.- Scalability: This pattern doesn't scale well for apps with many routes.
Consider: Either clarify that this is a simplified example for learning, or recommend a lightweight router library (e.g., TanStack Router, Wouter) as a better alternative for real applications.
You could add a note like:
#### Step 2: Configure Router with Custom Pages -Set `builtInAuth: false` and provide your page components: +Set `builtInAuth: false` and provide your page components. + +**Note:** The example below uses basic path matching for simplicity. For production apps, consider using a lightweight router library like TanStack Router or Wouter for better navigation and state management.Or offer an example with a simpler router library as an alternative block.
71-71: Grammar: Use hyphens for compound modifiers.Lines 71 and 74 use two-word phrases that would benefit from hyphenation:
- Line 71: "hosted auth pages" → "hosted-auth pages"
- Line 74: "signin or signup page" → "sign-in or sign-up page"
These are minor style suggestions and can be addressed if your documentation guidelines prefer it.
- `builtInAuth` (optional): By default use InsForge hosted auth pages + `builtInAuth` (optional): By default use InsForge hosted-auth pages- `loadingFallback` (optional): Custom component to display when redirecting to signin or signup page + `loadingFallback` (optional): Custom component to display when redirecting to sign-in or sign-up pageAlso applies to: 74-74
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/core-concepts/authentication/ui-components/nextjs.mdx(7 hunks)docs/core-concepts/authentication/ui-components/react-router.mdx(1 hunks)docs/core-concepts/authentication/ui-components/react.mdx(11 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to frontend/src/**/use[A-Z]*.ts : Hook files must be named usePascalCase.ts (e.g., useAuth.ts)
Applied to files:
docs/core-concepts/authentication/ui-components/nextjs.mdxdocs/core-concepts/authentication/ui-components/react-router.mdx
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to frontend/src/**/*.{tsx,ts} : Use functional React components with hooks exclusively
Applied to files:
docs/core-concepts/authentication/ui-components/nextjs.mdxdocs/core-concepts/authentication/ui-components/react.mdx
📚 Learning: 2025-11-04T05:18:26.126Z
Learnt from: Fermionic-Lyu
Repo: InsForge/InsForge PR: 553
File: docs/changelog.mdx:6-35
Timestamp: 2025-11-04T05:18:26.126Z
Learning: The InsForge JavaScript SDK repository is named "insforge-sdk-js" and is located at https://github.com/insforge/insforge-sdk-js
Applied to files:
docs/core-concepts/authentication/ui-components/nextjs.mdxdocs/core-concepts/authentication/ui-components/react.mdx
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to backend/src/api/**/*.ts : Implement authentication and error-handling middleware
Applied to files:
docs/core-concepts/authentication/ui-components/nextjs.mdx
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to frontend/src/**/*.{ts,tsx} : Use React Hook Form for form handling with Zod validation
Applied to files:
docs/core-concepts/authentication/ui-components/react.mdx
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to frontend/src/**/*.{tsx} : Use lazy loading for code splitting
Applied to files:
docs/core-concepts/authentication/ui-components/react.mdx
📚 Learning: 2025-10-15T18:18:47.519Z
Learnt from: CR
Repo: InsForge/InsForge PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-10-15T18:18:47.519Z
Learning: Applies to frontend/src/**/*.{tsx,ts} : Optimize React component re-renders
Applied to files:
docs/core-concepts/authentication/ui-components/react.mdx
🪛 LanguageTool
docs/core-concepts/authentication/ui-components/react.mdx
[grammar] ~71-~71: Use a hyphen to join words.
Context: ...uth(optional): By default use InsForge hosted auth pages -paths` (optional): ...
(QB_NEW_EN_HYPHEN)
[grammar] ~74-~74: Ensure spelling is correct
Context: ...o display when redirecting to signin or signup page ### Step 3: Use Hooks & Component...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
docs/core-concepts/authentication/ui-components/react-router.mdx
[grammar] ~62-~62: Use a hyphen to join words.
Context: ...red): Redirect URL after successful sign in (default: '/') - onSignIn (option...
(QB_NEW_EN_HYPHEN)
[grammar] ~63-~63: Use a hyphen to join words.
Context: ...): Custom function to sync token on sign in - onSignOut (optional): Custom func...
(QB_NEW_EN_HYPHEN)
[grammar] ~64-~64: Use a hyphen to join words.
Context: ...tom function to clear auth state on sign out ### Step 3: Configure Router (Built...
(QB_NEW_EN_HYPHEN)
[grammar] ~452-~452: Use a hyphen to join words.
Context: ...terSignOutUrl- Redirect URL after sign out ###` Complete ...
(QB_NEW_EN_HYPHEN)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: E2E Tests
- GitHub Check: CI Pre-merge Check
🔇 Additional comments (8)
docs/core-concepts/authentication/ui-components/react-router.mdx (1)
613-632: Example code uses correct new API shape.The
usePublicAuthConfig()example correctly accessesauthConfig.oAuthProvidersandauthConfig?.passwordMinLength, aligning with the updated public API introduced in this PR.docs/core-concepts/authentication/ui-components/nextjs.mdx (2)
286-288: User object documentation updated consistently.The
useUser()return value now documents user object with optional properties (name?, avatarUrl?), which correctly reflects the updated schema and aligns with safe property access patterns.
298-305: usePublicAuthConfig API shape correctly reflected.The example correctly demonstrates accessing
authConfig.oAuthProvidersandauthConfig?.passwordMinLengthfrom the new API shape, with appropriate optional chaining forpasswordMinLength.docs/core-concepts/authentication/ui-components/react.mdx (5)
26-26: Dependencies correctly simplified.Removing
react-router-domfrom required dependencies aligns with the new RouteGuard-based approach, which no longer requires explicit router setup. The simpler dependency list better reflects the framework-agnostic nature of the package.Also applies to: 29-29
39-39: RouteGuard introduction simplifies setup.The new RouteGuard component wrapping App eliminates the need for explicit React Router configuration. This reduces boilerplate and makes the quick-start more accessible. The props documentation (lines 69–74) clearly outlines the available options (builtInAuth, publicRoutes, loadingFallback).
Also applies to: 50-74
93-93: Optional chaining on user property: Intentional safety pattern.Line 93 uses
{user?.email}with optional chaining, whereas the nextjs.mdx example (line 117) uses{user.email}without it. Both patterns are correct depending on context:
user?.emailis safer if user could be null/undefined (defensive).user.emailis fine if you're certain user exists (e.g., inside a<SignedIn>component).Since line 91 wraps this in
<SignedIn>, direct access is safe. Either approach is acceptable; just ensure consistency across documentation if possible.
440-441: JSX comment syntax corrected.The fix from
// Custom logicto{/* Custom logic */}is correct—inline JSX comments must use the{/* */}syntax. Good catch on the prior fix.
561-572: usePublicAuthConfig example correctly updated to new API shape.The example reflects the updated public API:
authConfigreturned as an object containingoAuthProvidersandpasswordMinLength, with proper optional chaining on the latter.
Summary
How did you test this change?
Summary by CodeRabbit
New Features
Documentation
Chores