Skip to content

chore(tanstack-react-start,nuxt): Pass treatPendingAsSignedOut to auth functions#6612

Merged
wobsoriano merged 6 commits intomainfrom
rob/pending-session-nuxt-tanstack
Aug 22, 2025
Merged

chore(tanstack-react-start,nuxt): Pass treatPendingAsSignedOut to auth functions#6612
wobsoriano merged 6 commits intomainfrom
rob/pending-session-nuxt-tanstack

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Aug 22, 2025

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Auth helpers now accept optional per-call settings (e.g., treatPendingAsSignedOut) for finer pending-session handling.
    • Per-call token acceptance can be specified when calling auth/getAuth.
  • Improvements

    • Unified options support across server frameworks and examples; middleware/context auth forwards options.
  • Compatibility

    • Public API shapes remain compatible; existing calls continue to work without providing options.

@changeset-bot
Copy link

changeset-bot bot commented Aug 22, 2025

🦋 Changeset detected

Latest commit: 1b12269

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/nuxt Patch
@clerk/tanstack-react-start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Aug 22, 2025 8:20pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 22, 2025

📝 Walkthrough

Walkthrough

Adds per-call auth options (PendingSessionOptions) to Nuxt and TanStack React Start server code. Nuxt middleware refactors auth object retrieval into an authObjectFn(opts) that calls requestState.toAuth(opts); the Proxy and initial client state now read from this function and token acceptance is determined per-call. Types changed to use PendingSessionOptions & Pick<AuthenticateRequestOptions, 'acceptsToken'>. getAuth and event.context.auth signatures now accept an optional options parameter (including treatPendingAsSignedOut). Import lists updated where needed and public API shapes remain compatible.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 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
  • 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 dbfb8ad and 1b12269.

📒 Files selected for processing (1)
  • .changeset/ninety-wombats-think.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/ninety-wombats-think.md
⏰ 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). (23)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Static analysis
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

🪧 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 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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 22, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6612

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6612

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6612

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6612

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6612

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6612

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6612

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6612

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6612

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6612

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6612

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6612

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6612

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6612

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6612

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6612

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6612

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6612

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6612

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6612

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6612

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6612

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6612

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6612

commit: 1b12269

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/nuxt/src/runtime/server/clerkMiddleware.ts (1)

117-125: Bug: Proxy get trap indexes the function type instead of the auth object

return authObjectFn()?.[prop as keyof typeof authObjectFn]; treats authObjectFn (a function) as the indexed target. This is a TypeScript typing mistake and can also be fragile at runtime for symbol keys. Forward to the actual auth object via Reflect.get.

Apply this diff:

     const auth = new Proxy(authHandler, {
       get(target, prop, receiver) {
         deprecated('event.context.auth', 'Use `event.context.auth()` as a function instead.');
         // If the property exists on the function, return it
         if (prop in target) return Reflect.get(target, prop, receiver);
-        // Otherwise, get it from the authObject
-        return authObjectFn()?.[prop as keyof typeof authObjectFn];
+        // Otherwise, forward the property access to the current auth object
+        const authObject = authObjectFn();
+        return Reflect.get(authObject as unknown as Record<PropertyKey, unknown>, prop, receiver);
       },
     });
🧹 Nitpick comments (6)
packages/tanstack-react-start/src/server/getAuth.ts (3)

11-21: Signature and Request guard look fine; clarify intent in JSDoc

The function keeps the legacy (request, opts?) signature, only using request for presence checks while sourcing the auth object from context. Add a short JSDoc note that request is only validated (not consumed) to avoid confusion for integrators.


22-24: Forward only pending-session options to authObjectFn (future-proofing)

Right now you pass { treatPendingAsSignedOut }. If PendingSessionOptions grows, the current code will need changes. Slightly generalize while still excluding acceptsToken:

-  const authObject = await Promise.resolve(authObjectFn({ treatPendingAsSignedOut: opts?.treatPendingAsSignedOut }));
+  const pendingOptions = opts ? { treatPendingAsSignedOut: opts.treatPendingAsSignedOut } : undefined;
+  const authObject = await Promise.resolve(authObjectFn(pendingOptions));

25-26: Default behavior for acceptsToken should be documented

You pass opts?.acceptsToken through to getAuthObjectForAcceptedToken. Please document in the JSDoc what happens when acceptsToken is omitted (i.e., the default behavior), so callers know when to supply it explicitly.

I can add the JSDoc to this function and align it with the Nuxt middleware docs—want me to push a follow-up?

packages/nuxt/src/runtime/server/clerkMiddleware.ts (1)

112-130: Add examples and deprecation note to public docs

Since event.context.auth now prefers function calls and supports per-call pending-session options, please update the Nuxt docs/JSDoc:

  • Show event.context.auth({ treatPendingAsSignedOut: false }).
  • Clarify that property access is deprecated and will log a warning.

I can draft the JSDoc snippet for this file and types.ts if helpful.

packages/nuxt/src/runtime/server/types.ts (1)

16-46: Overloads updated correctly; add JSDoc for PendingSessionOptions

The final overload (options?: PendingSessionOptions): SessionAuthObject aligns with the new per-call semantics. Augment the examples to include:

  • event.context.auth({ treatPendingAsSignedOut: false })
  • Clarify default: treatPendingAsSignedOut defaults to true.

This will help consumers rely on type hints and examples.

I can add the JSDoc blocks with examples and defaults inline here.

packages/tanstack-react-start/src/server/middlewareHandler.ts (1)

28-35: Note on accepted tokens: limit to pending-session options by design

Unlike Nuxt, TanStack’s event.context.auth intentionally accepts only PendingSessionOptions. Filtering by token type is handled in getAuth() via getAuthObjectForAcceptedToken. Consider a short comment in this file to make that design explicit for maintainers.

📜 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
  • 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 7168243 and ad8a5a4.

📒 Files selected for processing (4)
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts (3 hunks)
  • packages/nuxt/src/runtime/server/types.ts (2 hunks)
  • packages/tanstack-react-start/src/server/getAuth.ts (2 hunks)
  • packages/tanstack-react-start/src/server/middlewareHandler.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Files:

  • packages/nuxt/src/runtime/server/types.ts
  • packages/tanstack-react-start/src/server/middlewareHandler.ts
  • packages/nuxt/src/runtime/server/clerkMiddleware.ts
  • packages/tanstack-react-start/src/server/getAuth.ts
🧬 Code graph analysis (4)
packages/nuxt/src/runtime/server/types.ts (1)
packages/types/src/session.ts (1)
  • PendingSessionOptions (34-40)
packages/tanstack-react-start/src/server/middlewareHandler.ts (1)
packages/types/src/session.ts (1)
  • PendingSessionOptions (34-40)
packages/nuxt/src/runtime/server/clerkMiddleware.ts (4)
packages/types/src/session.ts (1)
  • PendingSessionOptions (34-40)
packages/nuxt/src/runtime/server/types.ts (2)
  • AuthFn (16-46)
  • AuthOptions (11-11)
integration/templates/nuxt-node/server/api/me.js (1)
  • event (4-4)
packages/nuxt/src/runtime/server/utils.ts (1)
  • createInitialState (20-23)
packages/tanstack-react-start/src/server/getAuth.ts (3)
packages/nextjs/src/server/createGetAuth.ts (1)
  • GetAuthOptions (18-20)
packages/types/src/session.ts (1)
  • PendingSessionOptions (34-40)
packages/backend/src/tokens/types.ts (1)
  • AuthenticateRequestOptions (19-75)
⏰ 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). (22)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (tanstack-react-router, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (6)
packages/tanstack-react-start/src/server/getAuth.ts (1)

9-9: Type alias aligns with cross-package convention

Using PendingSessionOptions & Pick<AuthenticateRequestOptions, 'acceptsToken'> matches the shape used in other packages and keeps the surface consistent.

packages/nuxt/src/runtime/server/clerkMiddleware.ts (3)

112-116: Per-call pending-session handling is correctly wired

authObjectFn(opts) returning requestState.toAuth(opts) and delegating to getAuthObjectForAcceptedToken inside authHandler give you the desired per-call behavior without mutating shared state.


129-130: Initial state built from authObjectFn() looks good

Seeding __clerk_initial_state from a fresh auth object ensures it reflects the default treatPendingAsSignedOut behavior for clients.


112-125: No remaining deprecated event.context.auth property‐style usages found

A repository‐wide search (over *.ts, *.tsx, *.js, *.jsx) for event.context.auth not followed by () and for direct property accesses (e.g. .userId, .orgId, .sessionId, .actor, .claims) returned no occurrences beyond the middleware setup itself. No consumer code uses the deprecated property style, so no migration is needed. I’m resolving this comment.

packages/nuxt/src/runtime/server/types.ts (1)

11-11: Type shape matches other frameworks

AuthOptions = PendingSessionOptions & Pick<AuthenticateRequestOptions, 'acceptsToken'> mirrors the shape used in Next/TanStack and enables consistent per-call options.

packages/tanstack-react-start/src/server/middlewareHandler.ts (1)

33-35: TanStack event.context.auth(options?) forwarding is correct

Allowing (options?: PendingSessionOptions) and forwarding to requestState.toAuth(options) brings parity with Nuxt/Next behavior. No other changes needed here.

@wobsoriano wobsoriano changed the title chore(tanstack-react-start,nuxt): Pass treatPendingAsSignedOut to toAuth() chore(tanstack-react-start,nuxt): Pass treatPendingAsSignedOut to auth functions Aug 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
.changeset/ninety-wombats-think.md (3)

6-7: Add one-line context on what the option does.

A brief explanation will help readers scanning release notes understand “why” without opening the code.

-Allows passing of `treatPendingAsSignedOut` to auth functions:
+Allows passing of `treatPendingAsSignedOut` to auth functions (treats a pending session the same as a signed-out state when evaluating auth):

8-9: Use the package’s proper name in the heading.

The package is @clerk/tanstack-react-start. Consider reflecting that to avoid confusion with other TanStack runtimes.

-TanStack Start
+TanStack React Start

20-26: Confirm whether event.context.auth(...) is synchronous in Nuxt.

If event.context.auth returns a plain object (sync), the snippet is fine; if it’s async (returns a Promise), use await. Align with the actual return type to prevent copy/paste errors.

For async:

export default eventHandler(async (event) => {
  const { userId } = await event.context.auth({ treatPendingAsSignedOut: true });
  return { userId };
});
📜 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
  • 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 ad8a5a4 and dbfb8ad.

📒 Files selected for processing (1)
  • .changeset/ninety-wombats-think.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/ninety-wombats-think.md
⏰ 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). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/ninety-wombats-think.md (2)

1-4: Changeset front matter looks valid.

Package scopes and bump type (patch) are correct for a non-breaking option pass-through. No issues here.


10-17: Verified getAuth signature—example is correct.

The getAuth API across all packages (including tanstack-react-start, remix, react-router, fastify, and express) is defined as getAuth(request, opts?). There are no usages of a single-argument signature (getAuth(opts)), and all existing call sites pass both the request (or loader args) and an options object. The snippet in .changeset/ninety-wombats-think.md is therefore accurate and needs no adjustment.

"@clerk/tanstack-react-start": patch
---

Allows passing of `treatPendingAsSignedOut` to auth functions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can link to our docs that give more information around treatPendingAsSignedOut: https://clerk.com/docs/authentication/configuration/session-tasks#session-handling

```ts
const authStateFn = createServerFn({ method: 'GET' }).handler(async () => {
const request = getWebRequest()
const { userId } = await getAuth(request, { treatPendingAsSignedOut: true })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treatPendingAsSignedOut: true is already the default, so we could pass treatPendingAsSignedOut: false here

// Both `active` and `pending` sessions will be treated as authenticated when `treatPendingAsSignedOut` is `false` - `userId` will be returned
return { userId } 

@wobsoriano wobsoriano enabled auto-merge (squash) August 22, 2025 20:19
@wobsoriano wobsoriano merged commit 083820d into main Aug 22, 2025
39 checks passed
@wobsoriano wobsoriano deleted the rob/pending-session-nuxt-tanstack branch August 22, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants