[PR #5022] [MERGED] fix(device-authorization): fix client error type for deny device #5723

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5022
Author: @3ddelano
Created: 10/1/2025
Status: Merged
Merged: 10/1/2025
Merged by: @himself65

Base: canaryHead: fix/device-deny-error-types


📝 Commits (2)

  • 3eb7198 fix(device-authorization): fix client error type for deny device
  • b342922 chore: lint

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

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

📄 Description

Fixes #5021

Fixed the error type of the authClient.device.deny method provided by the device-authorization plugin.

const { error } = await authClient.device.deny({ userCode: "1"})

Before error type was:

{
    code?: string | undefined;
    message?: string | undefined;
    status: number;
    statusText: string;
} | null

After this pr, error type is:

{
    error: "invalid_request" | "expired_token";
    error_description: string;
    status: number;
    statusText: string;
}

Summary by cubic

Fixes the error response schema for the device authorization deny endpoint. Clients now get a structured error payload with error and error_description, supporting invalid_request and expired_token.

  • Bug Fixes
    • Added an error object to the deny device route schema (zod/OpenAPI) to standardize client error types and align with RFC 8628.

🔄 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/5022 **Author:** [@3ddelano](https://github.com/3ddelano) **Created:** 10/1/2025 **Status:** ✅ Merged **Merged:** 10/1/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/device-deny-error-types` --- ### 📝 Commits (2) - [`3eb7198`](https://github.com/better-auth/better-auth/commit/3eb7198ab16fd416282013fb6eb5da8eb7c5c45b) fix(device-authorization): fix client error type for deny device - [`b342922`](https://github.com/better-auth/better-auth/commit/b342922cf3c38b5be0898d045f9c87ad7b3c031b) chore: lint ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+8 -0) </details> ### 📄 Description Fixes #5021 Fixed the error type of the authClient.device.deny method provided by the device-authorization plugin. ```js const { error } = await authClient.device.deny({ userCode: "1"}) ``` Before error type was: ```js { code?: string | undefined; message?: string | undefined; status: number; statusText: string; } | null ``` After this pr, error type is: ```js { error: "invalid_request" | "expired_token"; error_description: string; status: number; statusText: string; } ``` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the error response schema for the device authorization deny endpoint. Clients now get a structured error payload with error and error_description, supporting invalid_request and expired_token. - **Bug Fixes** - Added an error object to the deny device route schema (zod/OpenAPI) to standardize client error types and align with RFC 8628. <!-- 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:32:56 -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#5723