Skip to content
Source
Sign inSign up
TanStack/router

fix: workos router.tsx typo + move api route into api/auth/callback.tsx #5048

Mergedmaxscn(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/5048/headmerged by SeanCassiere

Changed the auth callback route to be api/auth/callback.tsx, which matches the env.example. Also corrected a typo in router.tsx which prevents type safe loaders.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected a typo in the router declaration to restore proper editor autocomplete and types.
    • Updated the auth callback route from /callback to /api/auth/callback so the example app uses the new callback endpoint.
  • Chores

    • Adjusted internal auth module imports to match project reorganization (no runtime behavior changes).
    1. Caution

      Review failed

      The pull request is closed.

      Walkthrough

      Renames a module augmentation property rotuer → router and moves/renames the auth callback route from /callback → /api/auth/callback (with updated imports and generated route identifiers) across the React example project; no runtime logic changes besides route id/path and import paths.

      Changes

      Cohort / File(s)Summary
      Module augmentation property rename
      examples/react/start-workos/src/router.tsx
      Renamed rotuer → router in declare module '@tanstack/react-router' Register interface; type remains ReturnType<typeof createRouter>.
      Generated route tree updates
      examples/react/start-workos/src/routeTree.gen.ts
      Replaced route id/path /callback with /api/auth/callback; renamed imports/identifiers from CallbackServerRoute → ApiAuthCallbackServerRoute; updated all related type mappings, server route children, and TanStack server augmentations to reference the new path and symbol.
      Server route file path & imports
      examples/react/start-workos/src/routes/api/auth/callback.tsx
      Updated import paths (authkit/ssr relative path adjustments) and changed the server file route creation from createServerFileRoute('/callback') → createServerFileRoute('/api/auth/callback'); GET handler logic unchanged.

      Sequence Diagram(s)

      sequenceDiagram
        participant Client
        participant ServerRoute as ApiAuthCallbackServerRoute
        participant AuthKit as authkit/ssr
        Note over ServerRoute: route id/path = /api/auth/callback
        Client->>ServerRoute: GET /api/auth/callback
        ServerRoute->>AuthKit: getConfig() / getWorkOS() / saveSession()
        AuthKit-->>ServerRoute: auth response / session saved
        ServerRoute-->>Client: redirect / response

      Estimated code review effort

      🎯 3 (Moderate) | ⏱️ ~20 minutes

      Poem

      I twitch my nose and scurry through, From rotuer to router — tidy and new. Callback found a straighter track, /api/auth/callback — no turning back. A carrot-coded hop, I celebrate this view! 🥕


      📜 Recent review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      💡 Knowledge Base configuration:

      • MCP integration is disabled by default for public repositories
      • Jira integration is disabled by default for public repositories
      • Linear integration is disabled by default for public repositories

      You can enable these sources in your CodeRabbit configuration.

      📥 Commits

      Reviewing files that changed from the base of the PR and between f7857db1cf0db08e2fb749a3d67c3dde10620270 and 700c9ff6e1711280ec779cc94c85f4640da93a27.

      📒 Files selected for processing (2)
      • examples/react/start-workos/src/routeTree.gen.ts (5 hunks)
      • examples/react/start-workos/src/routes/api/auth/callback.tsx (1 hunks)
      ✨ Finishing Touches
      • 📝 Generate Docstrings
        🧪 Generate unit tests
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      🪧 Tips

      Chat

      There are 3 ways to chat with CodeRabbit:

      • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
        • I pushed a fix in commit <commit_id>, please review it.
        • Open a follow-up GitHub issue for this discussion.
      • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
      • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
        • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
        • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

      Support

      Need help? Create a ticket on our support page for assistance with any issues or questions.

      CodeRabbit Commands (Invoked using PR/Issue comments)

      Type @coderabbitai help to get the list of available commands.

      Other keywords and placeholders

      • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
      • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
      • Add @coderabbitai anywhere in the PR title to generate the title automatically.

      CodeRabbit Configuration File (.coderabbit.yaml)

      • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
      • Please see the configuration documentation for more information.
      • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

      Status, Documentation and Community

      • Visit our Status Page to check the current availability of CodeRabbit.
      • Visit our Documentation for detailed information on how to use CodeRabbit.
      • Join our Discord Community to get help, request features, and share feedback.
      • Follow us on X/Twitter for updates and announcements.
    2. SeanCassiere approved these changes

    3. View your CI Pipeline Execution ↗ for commit 700c9ff6e1711280ec779cc94c85f4640da93a27

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded57sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded2sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-09-04 20:39:22 UTC

    4. More templates

      @tanstack/arktype-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5048

      @tanstack/directive-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5048

      @tanstack/eslint-plugin-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5048

      @tanstack/history

      npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5048

      @tanstack/react-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5048

      @tanstack/react-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5048

      @tanstack/react-router-ssr-query

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5048

      @tanstack/react-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5048

      @tanstack/react-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5048

      @tanstack/react-start-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@5048

      @tanstack/react-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5048

      @tanstack/router-cli

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5048

      @tanstack/router-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5048

      @tanstack/router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5048

      @tanstack/router-devtools-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5048

      @tanstack/router-generator

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5048

      @tanstack/router-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5048

      @tanstack/router-ssr-query-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5048

      @tanstack/router-utils

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5048

      @tanstack/router-vite-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5048

      @tanstack/server-functions-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5048

      @tanstack/solid-router

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5048

      @tanstack/solid-router-devtools

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5048

      @tanstack/solid-start

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5048

      @tanstack/solid-start-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5048

      @tanstack/solid-start-plugin

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@5048

      @tanstack/solid-start-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5048

      @tanstack/start-client-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5048

      @tanstack/start-plugin-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5048

      @tanstack/start-server-core

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5048

      @tanstack/start-server-functions-client

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@5048

      @tanstack/start-server-functions-fetcher

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@5048

      @tanstack/start-server-functions-server

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@5048

      @tanstack/start-storage-context

      npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5048

      @tanstack/valibot-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5048

      @tanstack/virtual-file-routes

      npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5048

      @tanstack/zod-adapter

      npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5048

      commit: 700c9ff

    5. SeanCassiere merged thise9d4c5b

    6. SeanCassiere closed this

Sign in to join this conversation.