Better Auth

BA

Better Auth

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

Join

bug-reports

help

Request Keeps Pending (Express.js)

im using next.js for frontend and express for backend, why it keeps pending when i'm doing sign up with email and password?
No description

authClient.signOut error when multiSession() enabled with prisma adaptor

ERROR Invalid prisma.session.delete() invocation nextjs app - better-auth 0.5.2-beta.17 after encountered similar error on my project, i cloned the official demo app and replaced database adaptor with prisma ended up with the above mentioned error. error is not present when removing multiSession() plugin....
No description

Help with BETTER_AUTH_URL and Redirects for Server-Side Authentication in Figma Plugin

Hi everyone! I'm working on a Figma plugin and trying to handle authentication fully on the server-side using Better Auth. I've been running into some issues with the BETTER_AUTH_URL setting and the Google OAuth flow. Here's the situation: 1. Setting BETTER_AUTH_URL to the server URL (http://localhost:5000): - Since I want all authentication logic on the server side, I set BETTER_AUTH_URL=http://localhost:5000 in my .env. - However, when I try to authenticate with Google, I get the following error:...

Crypto not found

I'm running a Solid Start app using bun and sst, however I get this error in my console: ERROR crypto is not defined Better Auth I have absolutely no idea why this happening, i got it working for a moment, but it reappeared now....

Issue with ReadableStream is locked or disturbed error and Google Sign-In using Better Auth

Hi everyone! I'm using Better Auth (version 0.5.2-beta.16) for a project, and I've encountered a blocking issue during Google sign-in integration. My setup:...

Error when using Custom Tables

I am using Better Auth with NodeJS express written in Typescript. It works with default tables but when i customised the fields i get Cannot read properties of undefined (reading 'findFirst') error. auth.ts ```typescript import { betterAuth } from 'better-auth';...

ReferenceError: process is not defined (Cloudflare + Sveltekit)

Using BetterAuth in connection with Cloudflare and Sveltekit, brings following error: ReferenceError: process is not defined This internal error only appears in the deployed Version on Cloudflare and not the local one. Most likely duo using imports like for example the filesystem (fs) which is not nativly supported in Cloudflare....

Issue on NodeJS

I am using node js express with typescript. This is my tsconfig.json file ```json { "compilerOptions": {...

Google SSO not working

Social auth with google is currently not working for me. In my production environment and same for demo.better-auth.com/sign-in...

Error with Prisma

Is it normal the execution time takes awhile because i ran into this issue ``` This request could not be understood by the server: {"type":"UnknownJsonError","body":{"code":"P6004","message":"The Query did not produce a result...

signUp on server-side not sending sendVerificationEmail()

Since the changes in v0.4.12 (though I’m not 100% sure), sendVerificationEmail() is no longer triggered automatically when I call auth.api.signUpEmail(). Next.js Server-Action: ```ts...

Unable to use prismaAdapter on Node

I get an error ```typescript Cannot find module 'better-auth/adapters/prisma' or its corresponding type declarations. There are types at '.../node_modules/better-auth/dist/adapters/prisma.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.ts...

syntax error and generateId when using postgresql

Hi, I'm trying to generate a custom id in a postgres db, but there is an error when I try to use the syntax needed to add the generateId, when using: database: new Pool({ connectionString: ""...
No description

Using Hono

Hi. I am using Hono for my backend but i get an error process is not defined when trying to use session. I assume this is because its trying to get my env variables but Hono does not support process.env

Argument `username` is missing when connecting with GitHub Provider

```ts model User { id String @id username String name String...
No description

crossSubDomainCookies OAuth state mismatch

Hello, I am using better-auth together with cross SubDomain Cookies in turborepo, but I can't get it to work with google, when I try to log in it generates OAuth state mismatch error
No description

nextjs installation problem

Hola, acabo de clonar su ejemplo de nextjs y estoy tratando de hacerlo funcionar en local, ejecuto pnpm install y se instala todo correctamente excepto best-auth.
No description

Can't use Cloudflare D1 database with Hono backend on Cloudflare Workers

Due to the fact that the env context is only exposed to incoming requests, It can't seem to be possible to create a config for better-auth on Hono using the D1 Database from Cloudflare Workers. This example of D1 with better-auth is for the OpenNext new implementation for Workers, I'm wondering if there's a way to set it up also on Hono. I've been able to make it work from SolidStart with a similar configuration but I'm stuck on Hono, and I'd prefer to have the server backend of better-auth on a separate Hono Worker without relying on CF Functions from the full-stack app....

2fa with oauth with next js template

I'm trying to activate 2fa in your nextjs demo but I can't set the password to log in I'm using google You should be asked to set a password or send a code by email...
No description