[PR #5052] [MERGED] fix: properly encode callback url for email verificaiton #31342

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5052
Author: @Bekacru
Created: 10/2/2025
Status: Merged
Merged: 10/2/2025
Merged by: @Bekacru

Base: canaryHead: fix/callbackurl


📝 Commits (5)

  • 5ba0e09 reafactor: move user input parser to api endpoints
  • 2eafb78 chore: remove log
  • ecf2c63 fix: properly encode callback url for email verificaiton
  • 3dda261 Merge remote-tracking branch 'origin/canary' into fix/callbackurl
  • 2595bc3 chore: remove comments

📊 Changes

4 files changed (+49 additions, -16 deletions)

View changed files

📝 packages/better-auth/src/api/routes/email-verification.test.ts (+33 -0)
📝 packages/better-auth/src/api/routes/email-verification.ts (+8 -8)
📝 packages/better-auth/src/api/routes/sign-in.ts (+4 -5)
📝 packages/better-auth/src/api/routes/sign-up.ts (+4 -3)

📄 Description

closes #5015


Summary by cubic

Fixes broken verification links by URL-encoding callbackURL across email verification, sign-in, and sign-up. Also tightens input parsing so fields marked input: false cannot be set.

  • Bug Fixes

    • Encode callbackURL with encodeURIComponent in email verification, sign-in, and sign-up flows.
    • Preserve callbackURL with nested query params (added test coverage).
    • Encode callbackURL when re-sending verification on email change.
  • Refactors

    • Move parseUserInput to API endpoints; remove user-specific parsing from adapter factory.
    • Harden schema parsing: ignore unknown fields and reject values for fields with input: false (test added).

🔄 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/5052 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 10/2/2025 **Status:** ✅ Merged **Merged:** 10/2/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/callbackurl` --- ### 📝 Commits (5) - [`5ba0e09`](https://github.com/better-auth/better-auth/commit/5ba0e093ecd46b83bf9a593251164206ee2ba623) reafactor: move user input parser to api endpoints - [`2eafb78`](https://github.com/better-auth/better-auth/commit/2eafb786b78f3ebe045fb641263a8227652e87b4) chore: remove log - [`ecf2c63`](https://github.com/better-auth/better-auth/commit/ecf2c637f24501bb906276047613a8cc5494f6f3) fix: properly encode callback url for email verificaiton - [`3dda261`](https://github.com/better-auth/better-auth/commit/3dda261463e52ee17274b4c881798df8cd1465c6) Merge remote-tracking branch 'origin/canary' into fix/callbackurl - [`2595bc3`](https://github.com/better-auth/better-auth/commit/2595bc3f3d2e29df252ccc22df05863dd22f2611) chore: remove comments ### 📊 Changes **4 files changed** (+49 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/email-verification.test.ts` (+33 -0) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+8 -8) 📝 `packages/better-auth/src/api/routes/sign-in.ts` (+4 -5) 📝 `packages/better-auth/src/api/routes/sign-up.ts` (+4 -3) </details> ### 📄 Description closes #5015 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes broken verification links by URL-encoding callbackURL across email verification, sign-in, and sign-up. Also tightens input parsing so fields marked input: false cannot be set. - **Bug Fixes** - Encode callbackURL with encodeURIComponent in email verification, sign-in, and sign-up flows. - Preserve callbackURL with nested query params (added test coverage). - Encode callbackURL when re-sending verification on email change. - **Refactors** - Move parseUserInput to API endpoints; remove user-specific parsing from adapter factory. - Harden schema parsing: ignore unknown fields and reject values for fields with input: false (test added). <!-- 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-17 22:13:09 -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#31342