[PR #5586] [CLOSED] refactor(api): narrow boolean types to literals in JSON responses #14348

Closed
opened 2026-04-13 09:25:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5586
Author: @sushichan044
Created: 10/26/2025
Status: Closed

Base: canaryHead: sushichan044-202510261712-narrow-boolean-into-literal-in-json-response-def


📝 Commits (1)

  • b534735 refactor(api): narrow boolean types to literals in JSON responses

📊 Changes

8 files changed (+27 additions, -27 deletions)

View changed files

📝 packages/better-auth/src/api/routes/account.ts (+5 -5)
📝 packages/better-auth/src/api/routes/email-verification.ts (+5 -5)
📝 packages/better-auth/src/api/routes/ok.ts (+1 -1)
📝 packages/better-auth/src/api/routes/reset-password.ts (+3 -3)
📝 packages/better-auth/src/api/routes/session.ts (+3 -3)
📝 packages/better-auth/src/api/routes/sign-in.ts (+1 -1)
📝 packages/better-auth/src/api/routes/sign-out.ts (+1 -1)
📝 packages/better-auth/src/api/routes/update-user.ts (+8 -8)

📄 Description

Summary by cubic

Narrowed boolean fields in API JSON responses to literal types (true/false) to improve TypeScript inference. No runtime behavior or response payloads changed.

  • Refactors
    • Replaced boolean values with literals using as const for: status, success, ok, redirect.
    • Updated routes: account, email-verification, ok, reset-password, session, sign-in, sign-out, update-user.
    • Benefit: stronger, predictable response typings for clients.

🔄 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/5586 **Author:** [@sushichan044](https://github.com/sushichan044) **Created:** 10/26/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `sushichan044-202510261712-narrow-boolean-into-literal-in-json-response-def` --- ### 📝 Commits (1) - [`b534735`](https://github.com/better-auth/better-auth/commit/b534735bd840c0ffa97d73ec2f6d2c88339de417) refactor(api): narrow boolean types to literals in JSON responses ### 📊 Changes **8 files changed** (+27 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.ts` (+5 -5) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+5 -5) 📝 `packages/better-auth/src/api/routes/ok.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/reset-password.ts` (+3 -3) 📝 `packages/better-auth/src/api/routes/session.ts` (+3 -3) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/sign-out.ts` (+1 -1) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+8 -8) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Narrowed boolean fields in API JSON responses to literal types (true/false) to improve TypeScript inference. No runtime behavior or response payloads changed. - **Refactors** - Replaced boolean values with literals using `as const` for: status, success, ok, redirect. - Updated routes: account, email-verification, ok, reset-password, session, sign-in, sign-out, update-user. - Benefit: stronger, predictable response typings for clients. <!-- 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-13 09:25:51 -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#14348