[GH-ISSUE #9007] Few typos in docs #28577

Closed
opened 2026-04-17 20:01:26 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @dwalker93 on GitHub (Apr 7, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/9007

In the section Concepts -> Hooks -> cookies
example

Image

const signedCookie = await ctx.getSignedCookie("my-signed-cookie"); must be changed to const signedCookie = await ctx.getSignedCookie("my-signed-cookie", ctx.context.secret);
missing secret in the example

Section Integrations -> Next.js ->
1 in first proxy.ts example

Image

and

2 in middlewear.ts example

Image

have unnecessary comment,
// THIS IS NOT SECURE! // This is the recommended approach to optimistically redirect users // We recommend handling auth checks in each page/route

since both examples using auth.api.getSession instead of calling getSessionCookie to get the session.

Originally created by @dwalker93 on GitHub (Apr 7, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/9007 In the section Concepts -> Hooks -> [cookies](https://better-auth.com/docs/concepts/hooks#cookies) example <img width="674" height="230" alt="Image" src="https://github.com/user-attachments/assets/9ac8b3aa-b24f-43c3-9124-315827071f1a" /> `const signedCookie = await ctx.getSignedCookie("my-signed-cookie");` must be changed to `const signedCookie = await ctx.getSignedCookie("my-signed-cookie", ctx.context.secret);` missing secret in the example Section Integrations -> Next.js -> [1](https://better-auth.com/docs/integrations/next#nextjs-16-proxy) in first proxy.ts example <img width="854" height="476" alt="Image" src="https://github.com/user-attachments/assets/e26e7f88-5631-4234-a362-4b46c856baef" /> and [2](https://better-auth.com/docs/integrations/next#nextjs-1520-nodejs-runtime-middleware) in middlewear.ts example <img width="845" height="499" alt="Image" src="https://github.com/user-attachments/assets/409e3759-b922-4b68-9a39-99577af4f7e6" /> have unnecessary comment, `// THIS IS NOT SECURE! // This is the recommended approach to optimistically redirect users // We recommend handling auth checks in each page/route` since both examples using auth.api.getSession instead of calling getSessionCookie to get the session.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28577