[PR #5485] [MERGED] chore: add stateless auth demo #22931

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5485
Author: @himself65
Created: 10/22/2025
Status: Merged
Merged: 10/22/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/10/22/stateless-demo


📝 Commits (2)

📊 Changes

16 files changed (+623 additions, -0 deletions)

View changed files

demo/stateless/.env.example (+7 -0)
demo/stateless/.gitignore (+36 -0)
demo/stateless/next.config.ts (+7 -0)
demo/stateless/package.json (+25 -0)
demo/stateless/postcss.config.mjs (+5 -0)
demo/stateless/src/app/api/auth/[...all]/route.ts (+4 -0)
demo/stateless/src/app/api/user/route.ts (+41 -0)
demo/stateless/src/app/dashboard/page.tsx (+119 -0)
demo/stateless/src/app/globals.css (+83 -0)
demo/stateless/src/app/layout.tsx (+19 -0)
demo/stateless/src/app/page.tsx (+118 -0)
demo/stateless/src/lib/auth-client.ts (+7 -0)
demo/stateless/src/lib/auth.ts (+25 -0)
demo/stateless/tailwind.config.ts (+57 -0)
demo/stateless/tsconfig.json (+34 -0)
📝 pnpm-lock.yaml (+36 -0)

📄 Description

Summary by cubic

Add a stateless auth demo app using Better Auth with GitHub OAuth in Next.js. Sessions are stored in encrypted JWT cookies, with examples for both client and server access.

  • New Features

    • Next.js demo at demo/stateless with Tailwind and .env.example.
    • Better Auth configured with GitHub OAuth and Next.js route handler.
    • Client hooks (signIn, signOut, useSession) and a protected dashboard.
    • /api/user shows server-side session access from the JWT cookie (no DB).
  • Dependencies

    • Add next 16.0.0-beta.0, react 19.2.0, react-dom 19.2.0.
    • Add tailwindcss 4 and postcss; transpile better-auth packages in next.config.

🔄 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/5485 **Author:** [@himself65](https://github.com/himself65) **Created:** 10/22/2025 **Status:** ✅ Merged **Merged:** 10/22/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/10/22/stateless-demo` --- ### 📝 Commits (2) - [`88df09b`](https://github.com/better-auth/better-auth/commit/88df09b681a15dd0b3af69a61c337799d567efd6) chore: add stateless auth demo - [`9fa8715`](https://github.com/better-auth/better-auth/commit/9fa8715bf52435eea6bd4c92eda2c82fa2282198) fix: type ### 📊 Changes **16 files changed** (+623 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `demo/stateless/.env.example` (+7 -0) ➕ `demo/stateless/.gitignore` (+36 -0) ➕ `demo/stateless/next.config.ts` (+7 -0) ➕ `demo/stateless/package.json` (+25 -0) ➕ `demo/stateless/postcss.config.mjs` (+5 -0) ➕ `demo/stateless/src/app/api/auth/[...all]/route.ts` (+4 -0) ➕ `demo/stateless/src/app/api/user/route.ts` (+41 -0) ➕ `demo/stateless/src/app/dashboard/page.tsx` (+119 -0) ➕ `demo/stateless/src/app/globals.css` (+83 -0) ➕ `demo/stateless/src/app/layout.tsx` (+19 -0) ➕ `demo/stateless/src/app/page.tsx` (+118 -0) ➕ `demo/stateless/src/lib/auth-client.ts` (+7 -0) ➕ `demo/stateless/src/lib/auth.ts` (+25 -0) ➕ `demo/stateless/tailwind.config.ts` (+57 -0) ➕ `demo/stateless/tsconfig.json` (+34 -0) 📝 `pnpm-lock.yaml` (+36 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Add a stateless auth demo app using Better Auth with GitHub OAuth in Next.js. Sessions are stored in encrypted JWT cookies, with examples for both client and server access. - **New Features** - Next.js demo at demo/stateless with Tailwind and .env.example. - Better Auth configured with GitHub OAuth and Next.js route handler. - Client hooks (signIn, signOut, useSession) and a protected dashboard. - /api/user shows server-side session access from the JWT cookie (no DB). - **Dependencies** - Add next 16.0.0-beta.0, react 19.2.0, react-dom 19.2.0. - Add tailwindcss 4 and postcss; transpile better-auth packages in next.config. <!-- 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 21:22:30 -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#22931