[PR #6364] feat(device-authorization): support x-www-form-urlencoded #23519

Open
opened 2026-04-15 21:47:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6364
Author: @jslno
Created: 11/27/2025
Status: 🔄 Open

Base: mainHead: 11-27-2025/device-authorization-form-data


📝 Commits (5)

  • 3760559 feat(device-authorization): support x-www-form-urlencoded
  • 4a085f5 chore: cleanup
  • 1393c1d chore: cleanup
  • f484994 chore: fix linting
  • 92058c9 Merge branch 'canary' into 11-27-2025/device-authorization-form-data

📊 Changes

2 files changed (+219 additions, -42 deletions)

View changed files

📝 packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts (+80 -0)
📝 packages/better-auth/src/plugins/device-authorization/index.ts (+139 -42)

📄 Description

closes #6350


Summary by cubic

Adds x-www-form-urlencoded support to the device authorization flow. Clients can now send form-encoded bodies as an alternative to JSON across all device endpoints.

  • New Features
    • Accept FormData on /device/code, /device/token, /device/approve, and /device/deny.
    • Validate required fields with clear errors (client_id, device_code, grant_type, userCode).
    • Allow application/x-www-form-urlencoded and application/json on all four endpoints; added form data tests for code, token, approve, and deny.

Written for commit 92058c9d79. Summary will update automatically 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/6364 **Author:** [@jslno](https://github.com/jslno) **Created:** 11/27/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `11-27-2025/device-authorization-form-data` --- ### 📝 Commits (5) - [`3760559`](https://github.com/better-auth/better-auth/commit/3760559a5947522296c7a51eac18cc94e494912a) feat(device-authorization): support x-www-form-urlencoded - [`4a085f5`](https://github.com/better-auth/better-auth/commit/4a085f5efc31a2a3c00583bcf96968195e998606) chore: cleanup - [`1393c1d`](https://github.com/better-auth/better-auth/commit/1393c1d0b9edd64ae62b47f6e8881d9a8ea592de) chore: cleanup - [`f484994`](https://github.com/better-auth/better-auth/commit/f484994ad65e4680f54dc04ea53c6ad32ab142dd) chore: fix linting - [`92058c9`](https://github.com/better-auth/better-auth/commit/92058c9d798641e54db8f078ae83e7d19d8d4659) Merge branch 'canary' into 11-27-2025/device-authorization-form-data ### 📊 Changes **2 files changed** (+219 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts` (+80 -0) 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+139 -42) </details> ### 📄 Description closes #6350 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds x-www-form-urlencoded support to the device authorization flow. Clients can now send form-encoded bodies as an alternative to JSON across all device endpoints. - **New Features** - Accept FormData on /device/code, /device/token, /device/approve, and /device/deny. - Validate required fields with clear errors (client_id, device_code, grant_type, userCode). - Allow application/x-www-form-urlencoded and application/json on all four endpoints; added form data tests for code, token, approve, and deny. <sup>Written for commit 92058c9d798641e54db8f078ae83e7d19d8d4659. Summary will update automatically 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 21:47: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#23519