[PR #6143] [MERGED] fix(device-authorization): sanitize user code input on device approve #32079

Closed
opened 2026-04-17 22:56:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6143
Author: @Bekacru
Created: 11/20/2025
Status: Merged
Merged: 11/21/2025
Merged by: @Bekacru

Base: canaryHead: refactor/device-authorization


📝 Commits (1)

  • 7792722 fix(device-authorization): sanitize user code input on device approve

📊 Changes

1 file changed (+13 additions, -12 deletions)

View changed files

📝 packages/better-auth/src/plugins/device-authorization/index.ts (+13 -12)

📄 Description

Summary by cubic

Allows device approval with hyphenated user codes and deletes device codes only after successful authorization. Prevents lookup failures and premature cleanup during the device flow.

  • Bug Fixes
    • Normalize user code by removing dashes before lookup on approve.
    • Move device code deletion to run after authorization succeeds.

Written for commit 779272243b. 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/6143 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/20/2025 **Status:** ✅ Merged **Merged:** 11/21/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `refactor/device-authorization` --- ### 📝 Commits (1) - [`7792722`](https://github.com/better-auth/better-auth/commit/779272243bc202d5b438aec713dccb8a63d53127) fix(device-authorization): sanitize user code input on device approve ### 📊 Changes **1 file changed** (+13 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+13 -12) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Allows device approval with hyphenated user codes and deletes device codes only after successful authorization. Prevents lookup failures and premature cleanup during the device flow. - **Bug Fixes** - Normalize user code by removing dashes before lookup on approve. - Move device code deletion to run after authorization succeeds. <sup>Written for commit 779272243bc202d5b438aec713dccb8a63d53127. 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-17 22:56:35 -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#32079