Skip to content

Fix the httpCookies example - #734

Merged
Nicolapps merged 1 commit into
rebootfrom
nicolas/ssr-refresh-result-docs
Oct 21, 2026
Merged

Nicolapps merged 1 commit into
rebootfrom
nicolas/ssr-refresh-result-docs

Conversation

@Nicolapps

@Nicolapps Nicolapps commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

The example on the httpCookies reference entry (/api/ssr#httpcookies, also in the shipped .d.ts) didn't compile:

  • It passed authApi to ServerAuthSession, which has no such option. It takes refreshSession, cookies and cookieOptions.
  • It used the result of refresh() as a token bundle, but refresh() returns { kind: "rotated", tokens } | { kind: "noSession" }.

This rewrites the example with the real config and result shape.

Tracking: N-8 (Notion)

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
auth-v2 Ready Ready Preview Oct 21, 2026 12:35am UTC
1 Skipped Deployment
Project Deployment Actions Updated
convex-auth-docs Ignored Ignored Oct 21, 2026 12:35am UTC

Request Review

Nicolapps commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 4 files

Re-trigger cubic

Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
The example passed `authApi` to ServerAuthSession, which has no such
option (it takes `refreshSession`, `cookies` and `cookieOptions`), and
it used the result of `refresh()` as a token bundle, while it returns a
RefreshResult. Rewrite it with the real config and result shape.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
@Nicolapps
Nicolapps force-pushed the nicolas/ssr-refresh-result-docs branch from 14153bb to b360f3e Compare October 21, 2026 00:34
@Nicolapps Nicolapps changed the title Fix the httpCookies example and document RefreshResult Fix the httpCookies example Oct 21, 2026
@Nicolapps
Nicolapps requested a review from dowski October 21, 2026 00:37
@Nicolapps
Nicolapps merged commit a292d32 into reboot Oct 21, 2026
9 checks passed
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
The `httpCookies` example (fixed in #734) ended with a top-level `return`, which is only valid inside a function. This puts it in a `POST` route handler that receives the request.

Found by the doc example check in #763.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 21, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 27, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 27, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 27, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 27, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.
Nicolapps added a commit that referenced this pull request Oct 27, 2026
tsc does not read the code in a doc comment, thus the broken httpCookies
example fixed in #734 passed every check. Add `pnpm check:doc-examples`,
which typechecks each ts/tsx code block in the doc comments of
packages/core/src, and run it in CI.

The examples compile as modules of packages/doc-examples, a private Convex
app that installs every component and sets up every sign-in method, with
committed codegen. Thus api, internal, components, env and ctx have their
real generated types, and @/auth resolves to its SSR setup.

Fix the examples that the check finds: undeclared variables (the OAuth
examples now declare their own `auth`, the SSR examples import it from
@/auth), pseudo-code JSX, a top-level return, and a wrong import path for
`env`.

This branch was successfully deployed

1 active deployment
Preview – auth-v2 — b360f3e3 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant