Better Auth

BA

Better Auth

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

Join

bug-reports

help

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

Permissions type not updating after creating ac and adding to organization plugin.

Hi, I believe this is a bug, even after adding my own permissions.ts, and adding ac and all of the roles to my auth.ts and auth-client.ts, it shows that the only permissions available are the 3 default ones built into the plugin. Is there any more setup that needs to be done that I'm missing? I've looked through the source of better-auth and cant pinpoint the issue ```import { createAccessControl } from "better-auth/plugins/access"; const statement = {...
No description

Unable to build NextJS app because of better-auth dependency

Hello, I'm unaware since when I got this issue, though...
No description

Prisma error when updating an account password

Hello, I opened an issue on github : https://github.com/better-auth/better-auth/issues/581 But it feels like a "me" problem, if anyone can confirm or not...

Failed to initialize database adapter

On the latest version of Better Auth on 0.8.6-beta.3 trying to sign in with OAuth causes the following error: ```tsx [_ [BetterAuthError]: Failed to initialize database adapter] { cause: undefined...

oslo package

better-auth version: 0.8.6-beta.3
No description

Failed to initialize database adapter

I'm currently running the Drizzle adapter, and currently cannot get it to generate a schema. The following auth.ts causes the cli to throw: Failed to initalize database adapter ```ts...

Signin throws an occasional not valid JSON error

Hey everyone, I have a signin server action which simply lets user signin , but sometimes it throws a 500 error saying "<", "!DOCTYPE" ... is not valid JSON, I dont know what might cause this, also it can be the (Turso) database error, but am not sure, Why does it throw error occasionally or only at certain times? sometimes its quite frequent and gives very bad UX. This is my signin code : `signin: async ({ request, cookies }) => { let form = await request.formData(); let email = form.get('email') as string;...
No description