[PR #493] [MERGED] feat: nextjs plugin #11571

Closed
opened 2026-04-13 07:52:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/493
Author: @Bekacru
Created: 11/11/2024
Status: Merged
Merged: 11/11/2024
Merged by: @Bekacru

Base: mainHead: feat/next


📝 Commits (10+)

  • e0bfcdf fix: missing ctx on after hooks
  • e967605 fix: hook returns should always be typed as unkown
  • c9161d8 feat: next js plugin
  • 765afb3 fix: cookie attribtues
  • b85f8b6 fix: tests
  • 75b2969 fix: types
  • 27eddcf Merge remote-tracking branch 'origin/main' into feat/next
  • 5fb9448 fix: email-otp
  • 211e4f0 fix: test
  • 10a6638 feat: better integratino that doesnt requires asRequest

📊 Changes

138 files changed (+239 additions, -19088 deletions)

View changed files

📝 demo/nextjs/lib/auth.ts (+6 -0)
📝 docs/content/docs/examples/next-js.mdx (+1 -1)
📝 docs/content/docs/integrations/next.mdx (+31 -0)
examples/nextjs-example/.env.example (+0 -12)
examples/nextjs-example/.gitignore (+0 -42)
examples/nextjs-example/README.md (+0 -36)
examples/nextjs-example/app/(auth)/forget-password/page.tsx (+0 -127)
examples/nextjs-example/app/(auth)/reset-password/page.tsx (+0 -91)
examples/nextjs-example/app/(auth)/sign-in/page.tsx (+0 -30)
examples/nextjs-example/app/(auth)/two-factor/otp/page.tsx (+0 -109)
examples/nextjs-example/app/(auth)/two-factor/page.tsx (+0 -97)
examples/nextjs-example/app/accept-invitation/[id]/invitation-error.tsx (+0 -43)
examples/nextjs-example/app/accept-invitation/[id]/page.tsx (+0 -182)
examples/nextjs-example/app/admin/page.tsx (+0 -460)
examples/nextjs-example/app/api/auth/[...all]/route.ts (+0 -4)
examples/nextjs-example/app/dashboard/client.tsx (+0 -9)
examples/nextjs-example/app/dashboard/organization-card.tsx (+0 -532)
examples/nextjs-example/app/dashboard/page.tsx (+0 -36)
examples/nextjs-example/app/dashboard/user-card.tsx (+0 -833)
examples/nextjs-example/app/favicon.ico (+0 -0)

...and 80 more files

📄 Description

Currently, for next server actions/functions require users to manually parse Set-Cookie headers to set cookies in server actions. This plugin would automatically set cookies using Next's cookies helper whenever a Set-Cookie header is present.

closes #248

  • implementation
  • test
  • docs

���� 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/493 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/11/2024 **Status:** ✅ Merged **Merged:** 11/11/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feat/next` --- ### 📝 Commits (10+) - [`e0bfcdf`](https://github.com/better-auth/better-auth/commit/e0bfcdfa90b7ecc272ec7cf43ed5967521ea1563) fix: missing ctx on after hooks - [`e967605`](https://github.com/better-auth/better-auth/commit/e9676053beb8fc133ca37adf338c2810d8379b9f) fix: hook returns should always be typed as unkown - [`c9161d8`](https://github.com/better-auth/better-auth/commit/c9161d884ce2d433d4c5b07bfc618c70de732428) feat: next js plugin - [`765afb3`](https://github.com/better-auth/better-auth/commit/765afb3d3fedbf5797d950727fe57d91e86b1889) fix: cookie attribtues - [`b85f8b6`](https://github.com/better-auth/better-auth/commit/b85f8b66729b16791f1481369f147138d7147e20) fix: tests - [`75b2969`](https://github.com/better-auth/better-auth/commit/75b2969291fc58e4110efd988c51046d51962960) fix: types - [`27eddcf`](https://github.com/better-auth/better-auth/commit/27eddcf70f19651727699c513ed6ccc36ead5381) Merge remote-tracking branch 'origin/main' into feat/next - [`5fb9448`](https://github.com/better-auth/better-auth/commit/5fb94483240ae36ab28c70b5accdf2cc352f1920) fix: email-otp - [`211e4f0`](https://github.com/better-auth/better-auth/commit/211e4f06d45daeecd0cd44c8324d93e799743bdc) fix: test - [`10a6638`](https://github.com/better-auth/better-auth/commit/10a6638f744bb62ec20861922797a5e06e41862c) feat: better integratino that doesnt requires asRequest ### 📊 Changes **138 files changed** (+239 additions, -19088 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/lib/auth.ts` (+6 -0) 📝 `docs/content/docs/examples/next-js.mdx` (+1 -1) 📝 `docs/content/docs/integrations/next.mdx` (+31 -0) ➖ `examples/nextjs-example/.env.example` (+0 -12) ➖ `examples/nextjs-example/.gitignore` (+0 -42) ➖ `examples/nextjs-example/README.md` (+0 -36) ➖ `examples/nextjs-example/app/(auth)/forget-password/page.tsx` (+0 -127) ➖ `examples/nextjs-example/app/(auth)/reset-password/page.tsx` (+0 -91) ➖ `examples/nextjs-example/app/(auth)/sign-in/page.tsx` (+0 -30) ➖ `examples/nextjs-example/app/(auth)/two-factor/otp/page.tsx` (+0 -109) ➖ `examples/nextjs-example/app/(auth)/two-factor/page.tsx` (+0 -97) ➖ `examples/nextjs-example/app/accept-invitation/[id]/invitation-error.tsx` (+0 -43) ➖ `examples/nextjs-example/app/accept-invitation/[id]/page.tsx` (+0 -182) ➖ `examples/nextjs-example/app/admin/page.tsx` (+0 -460) ➖ `examples/nextjs-example/app/api/auth/[...all]/route.ts` (+0 -4) ➖ `examples/nextjs-example/app/dashboard/client.tsx` (+0 -9) ➖ `examples/nextjs-example/app/dashboard/organization-card.tsx` (+0 -532) ➖ `examples/nextjs-example/app/dashboard/page.tsx` (+0 -36) ➖ `examples/nextjs-example/app/dashboard/user-card.tsx` (+0 -833) ➖ `examples/nextjs-example/app/favicon.ico` (+0 -0) _...and 80 more files_ </details> ### 📄 Description Currently, for next server actions/functions require users to manually parse Set-Cookie headers to set cookies in server actions. This plugin would automatically set cookies using Next's cookies helper whenever a Set-Cookie header is present. closes #248 - [x] implementation - [x] test - [ ] docs --- <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-13 07:52:18 -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#11571