[PR #9008] [MERGED] docs: add missing secret to getSignedCookie and remove misleading comments #25266

Closed
opened 2026-04-15 22:47:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/9008
Author: @MuzzaiyyanHussain
Created: 4/7/2026
Status: Merged
Merged: 4/7/2026
Merged by: @gustavovalverde

Base: mainHead: fix/docs-typo


📝 Commits (5)

  • 10a56a1 fix(docs): correct getSignedCookie usage and remove misleading comments
  • 65c8897 added the comments back
  • a052450 fix(docs): restore Waku security warning and keep Next.js cleanup
  • 878c354 docs: remove misleading security note from Next.js middleware example
  • a41ae4d Merge branch 'main' into fix/docs-typo

📊 Changes

2 files changed (+2 additions, -8 deletions)

View changed files

📝 docs/content/docs/concepts/hooks.mdx (+1 -1)
📝 docs/content/docs/integrations/next.mdx (+1 -7)

📄 Description

Fix documentation issues in cookies and integrations

Changes

  • Updated getSignedCookie example to include the required secret parameter:

    • Added ctx.context.secret for proper signed cookie verification
  • Removed misleading/unnecessary comments from:

    • Next.js integration examples (proxy / middleware)
    • Waku integration middleware example

Why

  • getSignedCookie requires a secret to correctly validate signed cookies, which was missing in the example
  • The removed comments suggested the approach was "not secure", which is misleading since auth.api.getSession() is used correctly
  • Improves clarity and accuracy of documentation for developers

Scope

  • Documentation-only changes (no functional code changes)

Let me know if any refinements are needed 👍

Fixes #9007


Summary by cubic

Fixes hooks docs by adding the required secret to getSignedCookie and removes misleading security notes in Next.js examples. Docs-only.

  • Bug Fixes
    • Hooks: use await ctx.getSignedCookie("my-signed-cookie", ctx.context.secret) to validate signed cookies.
    • Next.js: removed "not secure" comments from proxy and middleware examples.

Written for commit a41ae4d933. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/9008 **Author:** [@MuzzaiyyanHussain](https://github.com/MuzzaiyyanHussain) **Created:** 4/7/2026 **Status:** ✅ Merged **Merged:** 4/7/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `fix/docs-typo` --- ### 📝 Commits (5) - [`10a56a1`](https://github.com/better-auth/better-auth/commit/10a56a1b8520d4d30d48df4c8f352f0e61722cd5) fix(docs): correct getSignedCookie usage and remove misleading comments - [`65c8897`](https://github.com/better-auth/better-auth/commit/65c88970ad7765c2c3b3e2bb6c9ffa6e45627807) added the comments back - [`a052450`](https://github.com/better-auth/better-auth/commit/a052450632568747c9e16da2c10cd8a37a12ff44) fix(docs): restore Waku security warning and keep Next.js cleanup - [`878c354`](https://github.com/better-auth/better-auth/commit/878c354aad392476b007737a8b25fa624a8f9eab) docs: remove misleading security note from Next.js middleware example - [`a41ae4d`](https://github.com/better-auth/better-auth/commit/a41ae4d9335e538bfb6bea10d1e26b2b41498300) Merge branch 'main' into fix/docs-typo ### 📊 Changes **2 files changed** (+2 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/hooks.mdx` (+1 -1) 📝 `docs/content/docs/integrations/next.mdx` (+1 -7) </details> ### 📄 Description ## Fix documentation issues in cookies and integrations ### Changes * Updated `getSignedCookie` example to include the required `secret` parameter: * Added `ctx.context.secret` for proper signed cookie verification * Removed misleading/unnecessary comments from: * Next.js integration examples (`proxy` / `middleware`) * Waku integration middleware example ### Why * `getSignedCookie` requires a secret to correctly validate signed cookies, which was missing in the example * The removed comments suggested the approach was "not secure", which is misleading since `auth.api.getSession()` is used correctly * Improves clarity and accuracy of documentation for developers ### Scope * Documentation-only changes (no functional code changes) Let me know if any refinements are needed 👍 Fixes #9007 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes hooks docs by adding the required `secret` to `getSignedCookie` and removes misleading security notes in Next.js examples. Docs-only. - **Bug Fixes** - Hooks: use `await ctx.getSignedCookie("my-signed-cookie", ctx.context.secret)` to validate signed cookies. - Next.js: removed "not secure" comments from `proxy` and `middleware` examples. <sup>Written for commit a41ae4d9335e538bfb6bea10d1e26b2b41498300. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:47:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25266