[PR #4243] [MERGED] fix: device authorization interval #5275

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

📋 Pull Request Information

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

Base: canaryHead: himself65/2025/08/26/fix


📝 Commits (2)

📊 Changes

2 files changed (+37 additions, -5 deletions)

View changed files

📝 packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts (+35 -0)
📝 packages/better-auth/src/plugins/device-authorization/index.ts (+2 -5)

📄 Description

Fixes: https://github.com/better-auth/better-auth/pull/3811#issuecomment-3221427066


Summary by cubic

Fixes device authorization polling interval handling by storing the interval in milliseconds in the database while returning seconds in the API. Prevents incorrect rate-limit checks when a string like "5s" was previously saved.

  • Bug Fixes
    • Persist pollingInterval as a number (ms) instead of the raw string.
    • Enforce min poll interval using the stored number, removing string parsing on read.
    • Add test to verify DB stores ms and API returns seconds.

🔄 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/4243 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/26/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/08/26/fix` --- ### 📝 Commits (2) - [`d1a9e83`](https://github.com/better-auth/better-auth/commit/d1a9e8362e200d325ab01243dede601d7c3024ed) fix: device authorization interval - [`63370d3`](https://github.com/better-auth/better-auth/commit/63370d3d530fd76d1ae1c8f0c975063d8f4e4e64) test: fix ### 📊 Changes **2 files changed** (+37 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/device-authorization/device-authorization.test.ts` (+35 -0) 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+2 -5) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/pull/3811#issuecomment-3221427066 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes device authorization polling interval handling by storing the interval in milliseconds in the database while returning seconds in the API. Prevents incorrect rate-limit checks when a string like "5s" was previously saved. - **Bug Fixes** - Persist pollingInterval as a number (ms) instead of the raw string. - Enforce min poll interval using the stored number, removing string parsing on read. - Add test to verify DB stores ms and API returns seconds. <!-- 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-03-13 12:16:31 -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#5275