[PR #3811] [MERGED] feat: support device authorization #5021

Closed
opened 2026-03-13 12:08:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3811
Author: @himself65
Created: 8/5/2025
Status: Merged
Merged: 8/21/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/08/05/on-device


📝 Commits (10+)

  • 8d3b46b feat: support device authorization
  • b0af7ec add ms to convert date
  • ae63044 draft! use zod schema for validation
  • bd890d0 draft! cache control
  • d544c5a draft! encodeURIComponent
  • e5d00cf fixup! input length for defaultGenerateDeviceCode
  • 0e8d82f fixup! update description
  • 25703bf fixup! use schema.ts
  • 0372fb7 fixup! align API
  • 838bb1a fixup! add exports

📊 Changes

28 files changed (+3150 additions, -74 deletions)

View changed files

demo/nextjs/app/(auth)/sign-in/loading.tsx (+16 -0)
📝 demo/nextjs/app/(auth)/sign-in/page.tsx (+4 -2)
📝 demo/nextjs/app/dashboard/user-card.tsx (+3 -2)
demo/nextjs/app/device/approve/page.tsx (+121 -0)
demo/nextjs/app/device/denied/page.tsx (+35 -0)
demo/nextjs/app/device/layout.tsx (+17 -0)
demo/nextjs/app/device/page.tsx (+94 -0)
demo/nextjs/app/device/success/page.tsx (+36 -0)
📝 demo/nextjs/components/sign-in.tsx (+6 -2)
📝 demo/nextjs/components/sign-up.tsx (+7 -2)
📝 demo/nextjs/lib/auth-client.ts (+2 -0)
📝 demo/nextjs/lib/auth.ts (+5 -0)
demo/nextjs/lib/shared.ts (+19 -0)
📝 docs/components/sidebar-content.tsx (+18 -0)
docs/content/docs/plugins/device-authorization.mdx (+654 -0)
📝 packages/better-auth/build.config.ts (+1 -0)
📝 packages/better-auth/package.json (+16 -0)
📝 packages/better-auth/src/client/plugins/index.ts (+1 -0)
packages/better-auth/src/plugins/device-authorization/client.ts (+16 -0)
packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts (+511 -0)

...and 8 more files

📄 Description

ETA: before 08/22/2025

Support device authorization, following RFC8628

Checklist


🔄 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/3811 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/5/2025 **Status:** ✅ Merged **Merged:** 8/21/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/08/05/on-device` --- ### 📝 Commits (10+) - [`8d3b46b`](https://github.com/better-auth/better-auth/commit/8d3b46b14c4ce2da4bfa67a344a96252cb2965e5) feat: support device authorization - [`b0af7ec`](https://github.com/better-auth/better-auth/commit/b0af7ec1ba1066d0e24641bf588c0b0ed9e4f057) add `ms` to convert date - [`ae63044`](https://github.com/better-auth/better-auth/commit/ae630440613b0be05e2af625fd3c3b01a73b4346) draft! use zod schema for validation - [`bd890d0`](https://github.com/better-auth/better-auth/commit/bd890d09b6f81765fee552822bab3c4e9821b05e) draft! cache control - [`d544c5a`](https://github.com/better-auth/better-auth/commit/d544c5ac78b93df5b9de4a89cde488896fb4ad76) draft! encodeURIComponent - [`e5d00cf`](https://github.com/better-auth/better-auth/commit/e5d00cf103b6d823621708c7648784a2424b321e) fixup! input length for defaultGenerateDeviceCode - [`0e8d82f`](https://github.com/better-auth/better-auth/commit/0e8d82f4ce80e38c211f9bea2477e4373d3e53ec) fixup! update description - [`25703bf`](https://github.com/better-auth/better-auth/commit/25703bf1433fa9a93522b3d0ce96e3ecbb4541dd) fixup! use schema.ts - [`0372fb7`](https://github.com/better-auth/better-auth/commit/0372fb77d923cc25d9a41b9f1c4305bc4d434561) fixup! align API - [`838bb1a`](https://github.com/better-auth/better-auth/commit/838bb1a6e3088014f0c9d60b25de4d6dca41a19b) fixup! add exports ### 📊 Changes **28 files changed** (+3150 additions, -74 deletions) <details> <summary>View changed files</summary> ➕ `demo/nextjs/app/(auth)/sign-in/loading.tsx` (+16 -0) 📝 `demo/nextjs/app/(auth)/sign-in/page.tsx` (+4 -2) 📝 `demo/nextjs/app/dashboard/user-card.tsx` (+3 -2) ➕ `demo/nextjs/app/device/approve/page.tsx` (+121 -0) ➕ `demo/nextjs/app/device/denied/page.tsx` (+35 -0) ➕ `demo/nextjs/app/device/layout.tsx` (+17 -0) ➕ `demo/nextjs/app/device/page.tsx` (+94 -0) ➕ `demo/nextjs/app/device/success/page.tsx` (+36 -0) 📝 `demo/nextjs/components/sign-in.tsx` (+6 -2) 📝 `demo/nextjs/components/sign-up.tsx` (+7 -2) 📝 `demo/nextjs/lib/auth-client.ts` (+2 -0) 📝 `demo/nextjs/lib/auth.ts` (+5 -0) ➕ `demo/nextjs/lib/shared.ts` (+19 -0) 📝 `docs/components/sidebar-content.tsx` (+18 -0) ➕ `docs/content/docs/plugins/device-authorization.mdx` (+654 -0) 📝 `packages/better-auth/build.config.ts` (+1 -0) 📝 `packages/better-auth/package.json` (+16 -0) 📝 `packages/better-auth/src/client/plugins/index.ts` (+1 -0) ➕ `packages/better-auth/src/plugins/device-authorization/client.ts` (+16 -0) ➕ `packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts` (+511 -0) _...and 8 more files_ </details> ### 📄 Description ETA: before 08/22/2025 Support device authorization, following [RFC8628](https://datatracker.ietf.org/doc/html/rfc8628) ## Checklist - [x] Unit test - [x] Document - [x] Error handling, see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 - [x] CLI demo - [x] Add demo on next --- <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-03-13 12:08:06 -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#5021