Better Auth

BA

Better Auth

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

Join

bug-reports

help

advanced.generateId: false is ignored in 1.2.6 with drizzleAdapter

Hi everyone, After updating to v1.2.6, I've encountered a problem where better-auth is generating IDs, which conflicts with my database that relies on UUIDs. The issue seems most likely related to the drizzleAdapter, as similar problems appeared with the passkey and emailOTP plugins. I temporarily downgraded to v1.2.5 to avoid the error, which looks like this:...
Solution:
okay try disabling auto generated Ids by setting advanced.database.generateId to false

New Prisma generate and init

i receved an error when npx @better-auth/cli generate with a new version of Prisma.
No description

cookie gets cleared after redirect in prod

cookies get cleared after redirect frontend -nextjs backend - expressjs better-authv1.2.2...

Google oauth not redirecting

Everything worked ok before. I had an issue working with google auth on iOS in previous thread. Now I’m back on web and notice when I click my sign in with google button nothing seems to happen. Before it would redirect to
https://accounts.google.com/o/oauth2/auth?response_type=code
https://accounts.google.com/o/oauth2/auth?response_type=code
. Now it does nothing. I tried logging g for errors but no error Relevant code ...
Solution:
have you enable disableDefaultFetchPlugins when you init the auth client?

Google Oauth error on 1.2.6

Hi. Today, after updating to 1.2.6, the CLI generates schema with uuid instead of id. I changed other schemas to use uuid, too, and used drizzle to modify the database. Now I get this error from the terminal: ```# SERVER_ERROR: [Error [PostgresError]: invalid input syntax for type uuid: "5W3ck3qLwc1PlpQnH7gS4Z5RMCtLZrHd"] {...
Solution:
There is a PR which fixes this, it will be merged as soon as @bekacru is available. Sorry for the inconvenience....

HaveIBeenPwned creates user anyway

I tried integrating the new haveIBeenPwned() plugin and found out that users are created, even if the password is marked as pwned. {code: "THE_PASSWORD_YOU_ENTERED_HAS_BEEN_COMPROMISED_PLEASE_CHOOSE_A_DIFFERENT_PASSWORD", message: "The password you entered has been compromised. Please choose a different password.", status: 400, statusText: "Bad Request"} 1. code = message? (I think it's good to customize the code in addition to the message for localization purposes)...
Solution:
npm i https://pkg.pr.new/better-auth/better-auth@2253

Invalid Callback URL on expo IOS when doing Google oauth

Hello everyone, I’m trying out Better Auth and I’m running into an issue with my google oauth. Error:...
Solution:
add business-copilot:/// as a trusted origin in your auth config

Google Sign-In throws Error in Production

Google Sign-In is working as expected in development (localhost), but in production, it throws the following error right after the sign-in process:
error = "please_restart_the_process"
error = "please_restart_the_process"
...

Spotify redirect url

Now Spotify does not allow to redirect to localhost, testing Spotify auth is not possible

Reference naming doesn't fit all use-cases

As title says, I'm extending organizations plugin and I'm referencing organizationId ```ts schema: { branch: { fields: {...
No description

Stripe: `onSubscriptionUpdate` passes old subscription data

When the onSubscriptionUpdate callback is fired, it passes the subscription data grabbed from the DB. However, this is the data before the updated properties are applied. For example, if a user switches from one plan to another, the passed subscription object contains the old plan, not the new one. Relevant code:...

Generic oauth failing on missing email

Ouath providers that do not offer an email claim fail when using the generic oauth plugin with email_is_missing. Seeing how both Twitter and Tiktok allow for null emails, I would expect similar behavior in the generic oauth plugin as well. Or, alternatively, a way (a la Auth.js) to write and use custom providers. Moreover, mapProfileToUser has no affect on the above as this method is being invoked after the email check fails. One must use a custom getUserInfo method to get around this restriction. See here: https://github.com/better-auth/better-auth/blob/6a0898fa88d1a49163b711fdbfa05489e0301a2c/packages/better-auth/src/plugins/generic-oauth/index.ts#L606...

authClient.signIn.email returns status 0 with empty statusText — No descriptive error

I'm trying to implement email/password sign-in using authClient.signIn.email inside a React Native (Expo) project, but I’m getting a bland, unhelpful error message: ```bash Copy Edit...

Stripe plugin: seems we can't reactivate a canceled subscription

Hello, The title is self-explanatory, once a subscription is canceled, it seems there's no way to return to the portal to reactivate it before it truly gets canceled. Steps to reproduce:...

webcrypto issue w/ vite6(vs. 5) rr v7 ssr while in cf-wrangler [minflare]

Its not a bug i can point to yet because the likelihood is that its almost certainly vite or the vite config's fault but the following combination and using vite 6 vs vite 5 causes webcrypto not resolving. this causes subtle bugs in better-auth that i didn't pick up on and i thought were related to linked generic oauth issues. ssr step reports this: node_modules/@noble/ciphers/esm/cryptoNode.js (6:77): "webcrypto" is not exported by "vite-browser-external", imported by "node_modules/@noble/ciphers/esm/cryptoNode.js". node_modules/@noble/hashes/esm/cryptoNode.js (11:9): "webcrypto" is not exported by "vite-browser-external", imported by "node_modules/@noble/hashes/esm/cryptoNode.js"....

Admin plugin : listUsers total is not correct

Hi, When using list users the total returned do not take into account the filter clause. sample: ` auth.api.listUsers({...

BetterAuthError [BetterAuthError: Session data is too large

Get the following error when using cookie cache with Microsoft OAuth.
BetterAuthError [BetterAuthError: Session data is too large to store in the cookie. Please disable session cookie caching or reduce the size of the session data] Not an issue for users who log in without an image on their Microsoft account. it would seem that the image which is base64 encoded causes the session data which includes sesssion and user to be over 4093...
No description

Stripe Webhook Fails When Processing User Subscription

The webhook fails due to invalid values for periodStart and periodEnd.
2025-04-02T23:00:28.177Z ERROR [Better Auth]: Stripe webhook failed. Error: Invalid db[getModelName(model)].update() invocation in C:\Users\ayrto\tibiaprofit.next\server\chunks\node_modules_better-auth_diste7fe42cb..js:3150:62...
Solution:
I believe it's due to this breaking change. @ayrtonaguiar Do you think you can downgrade your stripe version to @17.7.0 until this is fixed?...