Better Auth

BA

Better Auth

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

Join

bug-reports

help

issue getting session using mongodb

the login buttons work and i looking at the collection on mongodb it was able to insert the data, but when i try to check for a session on /dashboard using: ```ts auth.api.getSession({ headers: await headers() })...

High CPU usage when importing the library on a monorepo

As I am splitting my application into a monorepo solution using NX, I am facing performance issues with better-auth due to a recursive type in the automatic inference. The configuration it's pretty much straightforward: ```ts...
No description

timeout when get the body await request.json()

When making this request: ``` POST /api/test/auth/sign-in/email HTTP/1.1 Content-Type: application/json User-Agent: insomnia/9.3.3...
No description

Updating organization metadata

Currently, after updating organization metadata, the metadata gets stringified twice, causing the data to be stored as '[object object]' This should solve the problem theoretically by checking if the metadata already a string or not and stringifiying it based on that. I didn't have time to create a PR and clone the project so i just drafted this quickly from what I saw in the file File path: packages/better-auth/src/plugins/organization/adapter.ts ...

organization.acceptInvitation is throwing exception on sqlite - d1

ERROR Error D1_ERROR: near "where": syntax error at offset 22: SQLITE_ERROR Better Auth at processTicksAndRejections (node:internal/process/task_queues:95:5) at D1PreparedQuery.all (node_modules/src/d1/session.ts:194:16) at withReturning (node_modules/better-auth/dist/adapters/drizzle.js:1:8808)...

Unable to use Sign in with Apple

I get invalid request when im trying to access the redirect link from better auth. Heres the repo https://github.com/farisfaisalthena/better-auth-test...
No description

Typescript additional fields date type error

Jumping straight to example: Add additional fields in the db schema and in the auth config `user: { additionalFields: { birthday: { type: 'string', default: null },...

admin.listSessions returns 404 while userId is right

If I try to get every user session, I'll get a 404 error. Although I directly copied the User-ID and hardcoded it, it gives me 404:
const userSessions = await authClient.admin.listSessions({
userId: "9ogba97oE4UnKEQtEJZk2"
});
const userSessions = await authClient.admin.listSessions({
userId: "9ogba97oE4UnKEQtEJZk2"
});
...

Unable to use `mongodb` client

Hey there, I am having an issue using MongoDB with Better Auth. I have correctly initialized a mongodb client it seems, but Better Auth seems to be having an issue with it. If you have any pointers on how I might begin to debug this, I would greatly appreciate it. Error following authClient.signUp(). I can send the full error if needed by I am limited by Discord's post length here. Here the database is connected successfully. ``` βœ“ Compiled /api/auth/[...all] in 919ms...

2FA plugin accepts every password

I just tried to set up the Two Factor Plugin and I saw, that I can enter every password at twoFactor.enable. Every password gets accepted, which probably should not be the way to go.

Fix support to Bunx

When I want to use the cli's generate service with bunx (I don't have node or I shouldn't have node installed), it doesn't work... I force myself to install node and it does run with npx πŸ’€...
No description

In EmailOTP Plugin, the user is notVerified after signIn.

Once the signIn is done via OTP, the user's isVerified column still says false. The user should be marked as verified on signIn.

Expo 52, unexpected behavior when not having a property "callbackUrl", when calling OAuth signin

Hello, Following my message in another channel, when your signIn.social({provider: "google"}) call don't have the callbackURL property as well, the internal browser is not closing after login, and therefore your session is never acknowledged by the client So we might end up marking the callbackURL property mandatory ? ...

Example Support Auth Remix.js

Hi everyone, I'm trying to make a usage example for Remix.js Auth and theoretically it works but when I use the client methods it says I'm not authorized. https://remix.run/resources/remix-auth...
No description

CORS Issue with Access-Control-Allow-Credentials (true,true) in Better Auth

Issue Description I am encountering a persistent CORS policy issue when integrating Better Auth in my project. The browser blocks requests due to an invalid Access-Control-Allow-Credentials header value (true,true). Here’s the error message from the browser console: ```sh...
No description

demo active sessions

When adding a account, there doesn't seem to be a check to see if that account already exists in the sessions (or multi-session) causing stuff like the following to occur, where it'll say "Terminate" or "Sign out", and you can click all of them and not be signed out for the active session.
No description

demo user update for image

In the demo due to the CLI not working on canary, it pre-generated the schema, and when trying to update a user's image it will cause the following error: ```yaml ERROR Data too long for column 'image' at row 1 Better Auth
...

demo pass key

Decided to run the demo with pass keys, and when clicking "Add New Passkey" I run into the error of "The operation either timed out or was not allowed. See: https://www.w3.org/TR/webauthn-2/#sctn-privacy-considerations-client."

No control Over credentials on server side

Current Version: 0.8.6-beta.3 Tech Stack: Nextjs I applied email and password login in my project it works fine when we send a request from client to server and it checks with zod for client side validation and passes data correctly. But if we i use postman to send a request with credential information i have no control to check if the password or confirm password is correct or if password is in correct format. Even if i send wrong type of information using postman if accepts and creates a new user without a check at server. ...
No description