Better Auth

BA

Better Auth

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

Join

bug-reports

help

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 ...

[breaking] mapProfileToUser gets called twice when logging in via ID Tokens, breaking authentication

Hi, mapProfileToUser seems to be getting called twice when logging in via Social Provider ID Tokens. By putting a logger.info(); in the provider mapProfileToUser, you can see that it logs two values, the first being the actual response from the provider, the second one being the Better Auth user object. This leads to the UNABLE_TO_CREATE_USER error due to the fact that the second response does not contain provider-native arguments such as profile.given_name...

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...