[PR #6041] fix(oauth2): add missing logger.error calls in state.ts #14648

Open
opened 2026-04-13 09:33:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6041
Author: @jtomaszewski
Created: 11/17/2025
Status: 🔄 Open

Base: mainHead: vk/0d9c-add-missing-logg


📝 Commits (1)

  • f436b54 Done! I've added the missing logger.error calls in oauth2/state.ts:

📊 Changes

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

View changed files

📝 packages/better-auth/src/oauth2/state.ts (+6 -0)

📄 Description

Summary

Added missing logger.error calls in oauth2/state.ts to ensure consistent error logging whenever redirecting to errorURL.

Changes

  • Added logger.error for state mismatch when cookie value doesn't match (line 187-189)
  • Added logger.error for expired OAuth state (line 206-208)

Previously, some error redirects had logging while others didn't. This PR makes the logging consistent across all error cases.


Summary by cubic

Added missing logger.error calls in oauth2/state.ts so all OAuth error redirects are logged. Improves visibility and debugging for state-related failures.

  • Bug Fixes
    • Log state mismatch when the cookie value differs before redirecting to errorURL.
    • Log expired OAuth state before redirecting to errorURL.

Written for commit f436b5458e. 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/6041 **Author:** [@jtomaszewski](https://github.com/jtomaszewski) **Created:** 11/17/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `vk/0d9c-add-missing-logg` --- ### 📝 Commits (1) - [`f436b54`](https://github.com/better-auth/better-auth/commit/f436b5458e07748859903c0a92c8073dcf17fbd5) Done! I've added the missing `logger.error` calls in oauth2/state.ts: ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/state.ts` (+6 -0) </details> ### 📄 Description ## Summary Added missing `logger.error` calls in `oauth2/state.ts` to ensure consistent error logging whenever redirecting to `errorURL`. ## Changes - Added `logger.error` for state mismatch when cookie value doesn't match (line 187-189) - Added `logger.error` for expired OAuth state (line 206-208) Previously, some error redirects had logging while others didn't. This PR makes the logging consistent across all error cases. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added missing logger.error calls in oauth2/state.ts so all OAuth error redirects are logged. Improves visibility and debugging for state-related failures. - **Bug Fixes** - Log state mismatch when the cookie value differs before redirecting to errorURL. - Log expired OAuth state before redirecting to errorURL. <sup>Written for commit f436b5458e07748859903c0a92c8073dcf17fbd5. 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-13 09:33:49 -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#14648