Skip to content

fix(doctor): point COOKIE_DOMAIN_NOT_SET at a real docs URL#159

Open
sheldon-workos wants to merge 1 commit into
mainfrom
fix/cookie-domain-docs-url
Open

fix(doctor): point COOKIE_DOMAIN_NOT_SET at a real docs URL#159
sheldon-workos wants to merge 1 commit into
mainfrom
fix/cookie-domain-docs-url

Conversation

@sheldon-workos
Copy link
Copy Markdown

@sheldon-workos sheldon-workos commented May 26, 2026

Summary

workos doctor emits the warning below when AuthKit is detected and WORKOS_COOKIE_DOMAIN isn't set:

! COOKIE_DOMAIN_NOT_SET: Cookie domain not explicitly set
   → Consider setting WORKOS_COOKIE_DOMAIN for cross-subdomain auth
   Docs: https://workos.com/docs/authkit/cookie-domain

That docs URL 404s — there is no /authkit/cookie-domain page in the WorkOS docs. The env var is canonically documented in the authkit-nextjs README ("Optional configuration" section). This PR repoints the docsUrl there so the recommendation is actionable.

Test plan

  • pnpm typecheck passes
  • pnpm test passes (1800/1800)
  • pnpm build passes
  • Manually opened the new URL — https://github.com/workos/authkit-nextjs#optional-configuration resolves to the table that documents WORKOS_COOKIE_DOMAIN

Note on related broken URLs

While verifying, I noticed a few other workos.com/docs/authkit/* URLs in this file (and in src/doctor/checks/auth-patterns.ts) that also 404 today:

  • https://workos.com/docs/authkit/redirect-uri (issues.ts:42, auth-patterns.ts:324)
  • https://workos.com/docs/authkit/sign-out (auth-patterns.ts:139)
  • https://workos.com/docs/authkit/nextjs/middleware (auth-patterns.ts:194, 216)
  • https://workos.com/docs/authkit/nextjs/setup (auth-patterns.ts:254)

Left out of this PR to keep the change surgical — happy to do a follow-up that audits all docsUrl fields against the live docs site if that's wanted.

Made with Cursor

Summary by CodeRabbit

  • Documentation
    • Updated documentation references for cookie domain configuration guidance.

Review Change Stack

The remediation linked to https://workos.com/docs/authkit/cookie-domain,
which 404s. Repoint to the authkit-nextjs README's "Optional configuration"
section, which is where WORKOS_COOKIE_DOMAIN is actually documented.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: abc52f74-55c7-4222-9729-376bc52c600f

📥 Commits

Reviewing files that changed from the base of the PR and between 3deb4c0 and 96fcf53.

📒 Files selected for processing (1)
  • src/doctor/issues.ts

📝 Walkthrough

Walkthrough

This PR updates the documentation URL reference in the doctor module's issue definitions. The COOKIE_DOMAIN_NOT_SET issue now directs users to the GitHub AuthKit documentation instead of the previous WorkOS documentation link for cookie domain configuration.

Changes

Documentation URL Update

Layer / File(s) Summary
COOKIE_DOMAIN_NOT_SET documentation link
src/doctor/issues.ts
The docsUrl for the COOKIE_DOMAIN_NOT_SET issue definition is updated to point to GitHub AuthKit cookie-domain documentation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating the COOKIE_DOMAIN_NOT_SET issue to point to a valid documentation URL.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cookie-domain-docs-url

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR fixes a 404 docsUrl in the COOKIE_DOMAIN_NOT_SET issue definition by replacing the non-existent /docs/authkit/cookie-domain page with the authkit-nextjs README's #optional-configuration anchor, where WORKOS_COOKIE_DOMAIN is documented.

  • Changes one URL constant in src/doctor/issues.ts; no logic, types, or tests are affected.
  • The new URL is framework-specific (Next.js README), while the warning can fire for any AuthKit SDK — a generic docs page would be a better long-term target, but this is a clear improvement over a 404.

Confidence Score: 5/5

Safe to merge — a single URL constant is updated from a 404 to a live link with no logic changes.

The change is a one-line URL replacement in a static issue definition. The new URL resolves correctly and is a meaningful improvement. The only note is that the linked README is Next.js-specific while the warning can fire for any AuthKit SDK, but that is a pre-existing gap in coverage rather than a regression introduced here.

No files require special attention.

Important Files Changed

Filename Overview
src/doctor/issues.ts Replaces a broken 404 docs URL for COOKIE_DOMAIN_NOT_SET with a valid GitHub README anchor; no logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[workos doctor] --> B{sdk.isAuthKit &&\n!env.cookieDomain?}
    B -- Yes --> C[Emit COOKIE_DOMAIN_NOT_SET warning]
    C --> D[docsUrl shown to user]
    D -- Before PR --> E["404 https://workos.com/docs/authkit/cookie-domain"]
    D -- After PR --> F["OK https://github.com/workos/authkit-nextjs#optional-configuration"]
    B -- No --> G[No warning]
Loading

Reviews (1): Last reviewed commit: "fix(doctor): point COOKIE_DOMAIN_NOT_SET..." | Re-trigger Greptile

Comment thread src/doctor/issues.ts
message: 'Cookie domain not explicitly set',
remediation: 'Consider setting WORKOS_COOKIE_DOMAIN for cross-subdomain auth',
docsUrl: 'https://workos.com/docs/authkit/cookie-domain',
docsUrl: 'https://github.com/workos/authkit-nextjs#optional-configuration',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 URL is Next.js-specific but warning fires for all AuthKit SDKs

The new docsUrl points to the authkit-nextjs README, but COOKIE_DOMAIN_NOT_SET is emitted whenever report.sdk.isAuthKit is true (line 102), which covers non-Next.js AuthKit integrations (Remix, SvelteKit, etc.). Those users will be sent to Next.js-specific instructions that may not directly apply to their setup. A first-party docs page or a more generic reference would cover the full audience, though this is still a clear improvement over a 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant