[PR #6058] fix(oauth-proxy): add secure attribute and prevent double URL encoding #6413

Open
opened 2026-03-13 12:58:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6058
Author: @nakasyou
Created: 11/18/2025
Status: 🔄 Open

Base: canaryHead: fix/proxy-urls


📝 Commits (1)

  • 4137fa5 fix(oauth-proxy): add secure attr and use decodeURIComponent

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/plugins/oauth-proxy/index.ts (+5 -1)

📄 Description

Refers #6039

In #6039, cookies were prevented from being double URL-encoded, and the secure attribute was planned to be removed. This PR fixes these issues.


Summary by cubic

Fix cookie handling in the OAuth proxy by respecting the Secure attribute and decoding cookie values to avoid double-encoded cookies. This improves session reliability in secure environments.

  • Bug Fixes
    • Set options.secure when the Secure flag is present.
    • Decode cookie values with decodeURIComponent to prevent double URL encoding.

Written for commit 4137fa5527. 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/6058 **Author:** [@nakasyou](https://github.com/nakasyou) **Created:** 11/18/2025 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `fix/proxy-urls` --- ### 📝 Commits (1) - [`4137fa5`](https://github.com/better-auth/better-auth/commit/4137fa552728aa235e6aefa6593421f28e01c8ca) fix(oauth-proxy): add secure attr and use decodeURIComponent ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oauth-proxy/index.ts` (+5 -1) </details> ### 📄 Description Refers #6039 In #6039, cookies were prevented from being double URL-encoded, and the secure attribute was planned to be removed. This PR fixes these issues. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix cookie handling in the OAuth proxy by respecting the Secure attribute and decoding cookie values to avoid double-encoded cookies. This improves session reliability in secure environments. - **Bug Fixes** - Set options.secure when the Secure flag is present. - Decode cookie values with decodeURIComponent to prevent double URL encoding. <sup>Written for commit 4137fa552728aa235e6aefa6593421f28e01c8ca. 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-03-13 12:58:23 -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#6413