Better Auth

BA

Better Auth

Join the community to ask questions about Better Auth and get answers from other members.

Join

bug-reports

help

Stripe plugin - upgrade() creates two subscriptions instead of updating existing one.

I have two plans, "Starter" and "Pro". If a user upgrades their plan from "Starter" to "Pro" with the upgrade() method, there becomes two active subscriptions at the same time in Stripe (see image attached). This will bill the user for both plans, which isn't correct.
No description

`drizzleAdapter` is not handling `ne` operator

Hello, currently the convertWhereClause (L133) in drizzleAdapter is not handling the ne operator and fallsback to eq by default. Version: 1.2.7 This cause invalid data being returned on filters. See below example:...

Empty headers in verifyPhoneNumber API

I am receiving empty headers when I'm expecting it to to have better-auth.session_token set-cookie
No description

Stripe plugin create a new customer on subscription.upgrade click.

I have 2 different buttons to subscription.upgrade in my app. After user is registered customer is created in stripe according to createCustomerOnSignUp: true, in plugin config. But when I navigate to one of my 'Subscribe' buttons and click on it -> subscription.upgrade just creates new user in stripe instead of triggering checkout session: ```sh 2025-04-20 14:38:59 --> customer.created [evt_1RG3hf4FS9Rcg327BHPwlIez] 2025-04-20 14:38:59 <-- [200] POST http://localhost:3000/api/auth/stripe/webhook [evt_1RG3hf4FS9Rcg327BHPwlIez]...

change email does not update the customer's email in stripe

When executing an email change, the new email is not updated in the stripe's customer table in the dashboard. Is that something that is meant to be done manually? I would have expected BA to check if there is a customer Id set on that user and if so, trigger the change in stripe as well. Question is just, should it happen right after the change requested got accepted by the user (from the sendChangeEmailVerification email) or after the new email got verified. That could maybe depend on the `re...
Solution:
Hey are you able to open a github issue on this? In the mean time you can hse hooks to manually update users...

Period fields not populated after stripe subscription

Hello, period_start and period_end fields in the subscription object are not populated after a user subscribes via subscription.upgrade. Stripe : 17.7.0 Better-auth : 1.2.7...

Website is not available

The Better‑auth.com website is currently inaccessible in the UAE. I’ve tested it with several internet service providers: it was reachable as recently as last week, but for the past few days it has been returning a persistent DNS error.
No description

Starting v1.2.6 `database.generateId = false` still inserts Id into the verification table

On v1.2.6 onward (was working in v1.2.5), when setting database.generateId = false Id is still being generated for the verification table. I'm using pg with kysely-postgres-js ```js...

NextJS trailing slash ignored

Per title, if I set trailingSlash: true in my next config, I would expect better-auth to respect those same rules, as currently every request just hits a redirect as better-auth is querying URL's without a trailing slash

Doesn't always respect NextJS basepath

For example, if I set a basePath of '/test', after successfuly logging in I'll be redirected to simply '/', rather than '/'

member.createdAt has wrong timezone

When new members join an org, the membership.createdAt date is 2h into the future because of some timezone conversion error. In the attached images I joined an organization at 14:12 local time (12:12 UTC, which is what the DB stores), but the date that reaches the client is 14:12 UTC.
No description

Email Verification required and Captcha return the same error code

Hey! 👋 I think this might be a bug — or at least a DX issue — because the current implementation doesn’t let us differentiate between different failure cases. Here’s the relevant code: ...

Passkeys & verification Model, expiresAt always in past

With 1.2.7 I do not get passkeys login working anymore. In the database verification table I see expiresAt always have the same timestamp for each passkey createVerificationValue request (2025-04-16 10:07:45.958). This is in the past and I think this is the cause the browser do not start the webauthn process. Looks like at starting next.js server it's resulting into static timestamp of that moment. It does not recalculate the expirationTime for each createVerificationValue request. In code I found: ``` const expirationTime = new Date(Date.now() + 1e3 * 60 * 5);...

Session Not Updating & Expired session continues to be active

Issue 1 : Session Cookie, nor session expiration is being updated issue 2: Even After session is expired. Im getting valid session response (sending cookie manually) better-auth version 1.2.7 ...

Session info isn't available fast enough on manual page reload, server sign in api needs reload

For any brave soul willing help me with this problem I posted to better-auths github I've included the info from that issue below Using SolidStart and Postgresql - better-auth version: 1.2.7...

Authentication Flow Issue: Email Verification Not Syncing Across Sign-In Methods

We have a bug in our authentication flow that creates a confusing user experience: User creates an account with email & password User navigates to sign-in page Instead of using their email & password, user chooses "Sign in with Google" (using the same email)...

'/forget-password' rate limit is not working after latest update

After I updated to the latest version of Better-Auth (v1.2.7) built in rate limit for 'forget-password' is not applied anymore. Other paths rate limits seem to work as before

callbackURL not supported in v1.2.5

callbackURL is not supported in v1.2.5? I updated to new version, and auth.api.signUpEmail not support callbackURL what is solution?...

Latest update broke `emailAndPassword: {autoSignIn: true}`

Since the latest release, autoSignIn: true is broken on my side. Currently the project is setup with requireEmailVerification: true as well. I understand that the default behavior is set to true but even explicitly setting it wont fix it. I'm using Sveltekit. When reverting to a previous version it's magically fixed....

BetterAuth+Prisma given Too many Connections error

Hey, i've been having an issue with better auth. i tend to get too many connections error `` Invalid db[getModelName(model)].findFirst()` invocation in /Users/mac/Documents/workspace/business-copilot/business-copilot-webapp/node_modules/better-auth/dist/adapters/prisma-adapter/index.cjs:168:52 ...
Next