Better Auth

BA

Better Auth

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

Join

bug-reports

help

Expo Sign in with google

Hello everyone, I recently encountered a problem using Better Auth with Expo. What happens: I log in normally to the application (social login with Google), but when I log out and log back in and try to log in with Google again, it seems like it doesn't set the cookies. However, if I reload the app, I log in directly and the cookies are there. Note: I'm using auth through an API in hono.js.

better auth error 404

no matter what we do in api/auth/sign-up and api/auth/login it is giving us better auth error 404...

Redis as secondaryStorage generate a lot of client connection to my redis server

Hello, i have setup my redis client inside auth.ts to use it as a secondaryStorage, i have added inside my code a small redis.on("connect",... to log when a redis client is created, and i have see that at each new page who use auth there is a dedicated redis client. (I have 6 pages, in my redis i can see 8 connection (next -> 6, me -> 1, backend -> 1) Does i have this because i have a wrong better auth setup or something like that ? My code :...

Proxy Database Queries

I have a Next.js application using Better Auth, deployed on Vercel. My Better Auth instance is configured to use an Azure MS SQL database. When mounting the handler (cf. https://www.better-auth.com/docs/installation#mount-handler), it creates route handlers (endpoints) that are hosted via Vercel Functions. These functions have dynamic IP addresses (unless you upgrade to Vercel’s Enterprise plan and use Secure Compute), which creates an issue because the MS SQL database requires IP whitelisting for its firewall. So how can we proxy database queries through a dedicated API with a static IP address that can be whitelisted in Azure? Or is there another solution?...

Trusted Origins Wildcards

Hello, I'm running into following error and I'm clueless if it's perhaps a BetterAuth Bug. I'm setting up my previews on Vercel and added following trustedOrigins into my list: https://*-my-team-gmbh.vercel.app but it's not working as expected. ...

Custom Session Separate Client

How can I infer types in my backend custom session in a separate client where it's not possible to just import the type of the backend auth?

404 Error

auth-client; ```ts import { createAuthClient } from "better-auth/react"; import { usernameClient } from "better-auth/client/plugins"; import { polarClient } from "@polar-sh/better-auth"; ...

additional Fields on client

How can I get the additional fields set on the client an on user sign up use those values say for invitation or referrals? Is there anyway I can access this before or after user creation?

SvelteKit Client + BetterAuth Hono.js = Proper Setup and Cookie Issues?

I have been struggling with this for quite some time. 1. I am soley doing everything on client in SvelteKit (app.business.local) 2. I have a separate Hono.js server that is running betterAuth. I can successfully make calls to it (api.app.business.local). ...

Catching net::ERR_CONNECTION_REFUSED, with authClient?

Using authClient fort signIn: ```ts const { data, error } = await authClient.signIn.email({ email: f.data.email, password: f.data.password,...

using nexjs as a frontend and expressjs as a backend

I have my auth.ts on my expressjs backend and my auth-client.ts in my nextjs frontend but I want to get user info in my nextjs on server side can I add a second auth.ts file in my nextjs frontend so I will be able to use auth.api.getSession() in server side on my nextjs frontend while keeping the principal auth.ts in my beckend (expressjs) ?

when will better-auth infrastucture will be available

The company I work for would really want to have access to better-auth infrastucture is it possible to know when it will be out ?

Removing name from user table

I don't want to have the name in user table I want to replace it with firstName and lastName how can I do ?

getting user info on server side

I'm using nextjs for my frontend and expressjs for my backend. How can I get the user info on nextjs server (in my middleware) since the auth server config is on my expressjs backend

ERR_REQUIRE_ESM on better-auth 1.2.10 (not 1.2.11+) on Vercel Deployment

Hi ! First, thanks a lot for all the efforts put in the library, it's really a time saver for me πŸ™‚ I'm having exactly the same error as here (https://github.com/better-auth/better-auth/issues/3260) when deploying the project on Vercel (it doesn't trigger on a local build). I enforced a 1.2.10 version of better-auth to fix the problem but it still pops up. It does also happen when trying to bootstrap a blank Payload CMS project with npx create-payload-app@latest....

creating an organization with teams enabled is failing

when I try creating an organizastion the members is not being auto-created nor is it actually even working Also, 2nd image is when teams.defaultTeam is enabled...
No description

Drizzle TypeError: not enough arguments

i just started my instance today and all of a sudden fails to boot complaining about mysql key not provided. ive been using sqlite with drizzle all this time database: drizzleAdapter(dbClient, { provider: 'sqlite', schema: schema,...

Can't get someone elses github project to work

Im trying to start https://github.com/outpoot/rugplay yesterday everything was working suddenly not anymore i can't seem to find what the problem is using https://192.168.178.223:5173/...

Is there a way to add more infromation on sign-up?

I'm trying to add a new field in the user signup aside from the defaults. I wanted to add a field like invitedBy on the client, something like this: ```await authClient.signUp.email({ name:, email:,...