[PR #7200] fix(username): callbackURL in username sign-in doesn't work #7139

Open
opened 2026-03-13 13:25:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7200
Author: @ping-maxwell
Created: 1/8/2026
Status: 🔄 Open

Base: canaryHead: fix/username/callbackURL-not-working


📝 Commits (10+)

  • a6d6bfd fix(username): callbackURL in username sign-in doesn't work
  • fb4932f Merge branch 'canary' into fix/username/callbackURL-not-working
  • 47f97d4 add: unit tests
  • 9ada4bd update: remove redundent origin check
  • f5e3701 Merge branch 'canary' into fix/username/callbackURL-not-working
  • 0bb9bb7 fix: remove url from openapi
  • 30e20d4 Merge branch 'canary' into fix/username/callbackURL-not-working
  • d8e8931 Merge branch 'canary' into fix/username/callbackURL-not-working
  • bc64135 Merge branch 'canary' into fix/username/callbackURL-not-working
  • 3208de6 Merge branch 'canary' into fix/username/callbackURL-not-working

📊 Changes

3 files changed (+44 additions, -1 deletions)

View changed files

📝 docs/content/docs/plugins/username.mdx (+8 -0)
📝 packages/better-auth/src/plugins/username/index.ts (+15 -1)
📝 packages/better-auth/src/plugins/username/username.test.ts (+21 -0)

📄 Description

We defined a callbackURL & rememberMe option as part of the username sign-in endpoint, but both are not documented and the callbackURL logic wasn't implemented.

This PR fixes this. Also closes https://github.com/better-auth/better-auth/issues/6297


Summary by cubic

Fixes callbackURL redirect in username sign-in and documents callbackURL and rememberMe.

  • Bug Fixes
    • Redirect to callbackURL after successful sign-in (302).
    • Return redirect and url in the response when callbackURL is not provided.
    • Document callbackURL and rememberMe in the username plugin API.

Written for commit f36bada13f. Summary will update 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/7200 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/8/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `fix/username/callbackURL-not-working` --- ### 📝 Commits (10+) - [`a6d6bfd`](https://github.com/better-auth/better-auth/commit/a6d6bfd63f2101056642a2df8cb6eed96922906c) fix(username): `callbackURL` in username sign-in doesn't work - [`fb4932f`](https://github.com/better-auth/better-auth/commit/fb4932f8ea4d5938937eeef94a00156df532136a) Merge branch 'canary' into fix/username/callbackURL-not-working - [`47f97d4`](https://github.com/better-auth/better-auth/commit/47f97d4ce66e3c811e39102cea752bec4e82e5b2) add: unit tests - [`9ada4bd`](https://github.com/better-auth/better-auth/commit/9ada4bdfac8b09ff73ce43d437c5bfbd4e235540) update: remove redundent origin check - [`f5e3701`](https://github.com/better-auth/better-auth/commit/f5e3701cbb8435c8d7ffad9b92973b8edd135086) Merge branch 'canary' into fix/username/callbackURL-not-working - [`0bb9bb7`](https://github.com/better-auth/better-auth/commit/0bb9bb7c12dd0259b8f7fd4e265e9d29f8cd5cb8) fix: remove `url` from openapi - [`30e20d4`](https://github.com/better-auth/better-auth/commit/30e20d4db37c83cd007b6c3dd41ca2ac4006b092) Merge branch 'canary' into fix/username/callbackURL-not-working - [`d8e8931`](https://github.com/better-auth/better-auth/commit/d8e893110bf1eedd1aa37c20d3353f6316d864f3) Merge branch 'canary' into fix/username/callbackURL-not-working - [`bc64135`](https://github.com/better-auth/better-auth/commit/bc641358f0708851ddcdc3e90e0dd0d54bd0e8ad) Merge branch 'canary' into fix/username/callbackURL-not-working - [`3208de6`](https://github.com/better-auth/better-auth/commit/3208de6230f87c4be759ea4498d25a801f565ad2) Merge branch 'canary' into fix/username/callbackURL-not-working ### 📊 Changes **3 files changed** (+44 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/username.mdx` (+8 -0) 📝 `packages/better-auth/src/plugins/username/index.ts` (+15 -1) 📝 `packages/better-auth/src/plugins/username/username.test.ts` (+21 -0) </details> ### 📄 Description We defined a `callbackURL` & `rememberMe` option as part of the username sign-in endpoint, but both are not documented and the `callbackURL` logic wasn't implemented. This PR fixes this. Also closes https://github.com/better-auth/better-auth/issues/6297 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes callbackURL redirect in username sign-in and documents callbackURL and rememberMe. - **Bug Fixes** - Redirect to callbackURL after successful sign-in (302). - Return redirect and url in the response when callbackURL is not provided. - Document callbackURL and rememberMe in the username plugin API. <sup>Written for commit f36bada13f34cee1a14cb56c08bc85443c8a3c53. Summary will update 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 13:25:29 -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#7139