[PR #255] [MERGED] fix: use better auth url in nextjs middleware #28788

Closed
opened 2026-04-17 20:14:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/255
Author: @luksch42
Created: 10/20/2024
Status: Merged
Merged: 10/20/2024
Merged by: @Bekacru

Base: mainHead: use-better-auth-url-in-next-js-middleware


📝 Commits (2)

  • fbcf464 fix: use better auth url in nextjs middleware
  • c139876 fix: rename url to base url

📊 Changes

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

View changed files

📝 packages/better-auth/src/integrations/next-js.ts (+3 -3)

📄 Description

For hosting outside of Vercel, the middleware origin is set to localhost. This PR uses the BETTER_AUTH_URL environment variable, with the origin as a fallback.


🔄 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/255 **Author:** [@luksch42](https://github.com/luksch42) **Created:** 10/20/2024 **Status:** ✅ Merged **Merged:** 10/20/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `use-better-auth-url-in-next-js-middleware` --- ### 📝 Commits (2) - [`fbcf464`](https://github.com/better-auth/better-auth/commit/fbcf464192b336fb2699ede48fefe40e75553b60) fix: use better auth url in nextjs middleware - [`c139876`](https://github.com/better-auth/better-auth/commit/c1398767979949f714bd8c21e74eb5492a0c1cde) fix: rename url to base url ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/integrations/next-js.ts` (+3 -3) </details> ### 📄 Description For hosting outside of Vercel, the middleware origin is set to localhost. This PR uses the BETTER_AUTH_URL environment variable, with the origin as a fallback. --- <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 20:14:44 -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#28788