Better Auth

BA

Better Auth

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

Join

bug-reports

help

Better Auth Error after upgrade to 1.2.10

there is an error show after sign-in via google in https://www.better-auth.com/ and my website i try to downgrade and it fixed so the error comes with latest version any fix? http://localhost:3000/api/auth/error?error=please_restart_the_process...

403 forbibben response

403 forbidden and 401 error response are not getting after-hook, ` api: send-verification-email request:...

authClient.getSession wrong return type

when using authClient with ```ts fetchOptions: { throw: true }...
Solution:

[Organizations] usePlural doesn't work

Hey guys. Im facing this issue and not sure if the problem is on my side. When I use custom model names for Organization plugin like this: ``` plugins: [...

Member roles are duplicated

I'm having trouble creating a reproduction other than my project code; therefore asking here for some pointers on what might be wrong. When I use auth.api.updateMemberRole, if I pass an array to role, all the roles are duplicated. e.g. if I try to do updateMemberRole with:...

apiKey plugin `minimumNameLength` is not respected

apiKey plugin option of minimumNameLength works when there's at least one string character. But it does not work when the /api-key/createbody.name field is an empty string or when body = {}

Organization plugin gives type error:

I get the following type-error when adding the organization plugin to my better-auth server client. ``` Type '{ id: "organization"; endpoints: { createOrganization: { <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: { body: { name: string; slug: string; metadata?: Record<string, any> | undefined; userId?: string | undefined; logo?: string | undefined; keepCurrentActiveOrganization?: bo...' is not assignable to type 'BetterAuthPlugin'. Types of property 'schema' are incompatible....

Change email flow problem

Flows: 1. The user enters the new email address, and the backend uses the auth.api.changeEmail API to trigger the sending of a verification email. 2. The user receives the change email verification email. 3. The user clicks the email verification link....

Stripe plugin does not create subscription schema via CLI

Hello, after running npx @better-auth/cli generate, I noticed that the generated schema does not contain the subscription table. I also observed that the stripeCustomerId field in the users table was created correctly. "better-auth": "^1.2.8" "@better-auth/stripe": "^1.2.8" "stripe": "^18.0.0"...

Social Login Redirect Works, Email Login Redirect Fails Despite Correct Logs

I'm new to this and struggling with better-auth. Redirects work fine for social logins (Google, GitHub), but not for email login. The server logs show the redirect happening correctly (like "User recognized, redirecting to /account/profile" with a 302 status and Location: /account/profile in the network tab), but the browser doesn't follow it for email login. Instead, I get an APIError with empty headers (headers: Headers {}). Is this a bug in better-auth? I'm using authClient.signIn.email with fetchOptions: { redirect: "follow" } in a Next.js app. after: createAuthMiddleware(async (ctx) => { if (ctx.path === "/callback/:id" ctx.path === "/sign-in/email") { const session = ctx.context.newSession ctx.context.session;...

oAuthProxy broke in 1.2.9

I think this PR broke our oauth proxy for our local dev environments. Basically I'm seeing that on this line ctx.request.url is a http://localhost:3000 url, even though we run everything behind a dev domain on https. Should it not use the URL from oAuthProxy({ currentURL: https://my-local-htt...

Session apis returns null on client and server

The session api returns a null value in sveltekit even after successful account creation and login with all its associated functions being unresponsive(session list && response being unresponsive .Below is a sample snippet on the hooks.server.ts in sveltekit import { fail } from '@sveltejs/kit';...

trustedOrigins "chrome-extension://*" doesn't work

Contraitrement à ce qui est spécifié dans la documentation, configurer trustedOrigins comme ceci ne fonctionnera pas. Avez-vous une solution ? export const auth = betterAuth({ trustedOrigins: [...

stripe api only supports active subscriptions

When I user cancel subscription how this subscription then later be restored as calling authClient.subscription.list will return only active?

Is there a way to create a user server side?

auth.api doesn't seem to have a method for it, and client.signUp isn't intended for server-side use (I tried it and it didn't work).

Drizzle SQLite3 - Organisation plugin generates wrong schema

Like in the images shown, the generate command from the cli generates the schema wrong. member and pending should be strings instead of variables.
No description

CookieCache not working

Has this been talked about? I haven't been able to make it work, and I see many comments on this Github issue about it not working. https://github.com/better-auth/better-auth/issues/1752...

Forbidden error when invite member

Hi, Team. When I try to invite member using authClient.organization.inviteMember, it always gives me Forbidden 403 error. Fyi, I use my custom Role enum ("ADMIN" | "MEMBER") for member's role field...

No Redirect after MCP OAuth

Just created this one: https://github.com/better-auth/better-auth/issues/2914 Lmk if I missed anything. Currently this kinda blocks our MCP release as no test user was able to install the server themselves lol. Would be great if someone could look into it....

Verifications are created multiple times

I'm using google oauth2 in my elysia app, when I complete the oauth2 flow, I saw there is one more verification record not being consumed, so I tried multiple times, I found that oauth2 url is being created two times, sometimes oauth2 url is created one time but the console show the error scenrio 1: verifications being created two times { url: "https://accounts.google.com/o/oauth2/auth?...",...