New update makes my plugin error
the 1.2 update made my plugin throw
on the client side, everything works as expect, but the error is there....
Type never has no call signatures.
Type never has no call signatures.
Stripe | Make success_url optional?
Hey, when using embedded as ui_mode using the basic subscription implementation you get this error: "
success_url
is not supported with ui_mode: embedded
."
So my question is, if we could make success_url optional (and maybe more not sure if the cancelUrl needs also to be optional), so we can use it together in a embedded mode.
Not sure if this is a feature_request or bug, but i think a nice to have for everyone not wanting to use the default stripe hosted pages....Stripe Plugin bug
authClient.subscription.upgrade()
does not work with prisma, it says a column is missing even though the prisma studio shows it exists, the neon dashboard says it exists, and I can access the field using the prisma adapter in my code no problem.
``
# SERVER_ERROR: [Error [PrismaClientValidationError]:
Invalid
db[getModelName(model)].create()` invocation in...Solution:
Probably because you made
stripeSubscriptionId
required in your schema.
Just go to your schema.prisma and remove the ? on stripeSubscriptionId: String?
It has to be optional because this val comes from stripe, and is put in the db down the line by the webhook handler built into better-auth...Stripe Plugin | Received unknown parameters: params, options
As the Title states using for example: ``` getCheckoutSessionParams: async ({ user, session, plan, subscription }, request) => {
return {
params: {
allow_promotion_codes: true,
tax_id_collection: {...
Solution:
update to 1.2.2
Admin Plugin Issue with better-auth 1.2.1
found a type compatibility issue between the admin plugin and better-auth 1.2.1. the admin plugin's init function expects the old authcontext interface, but 1.2.1 requires a runMigrations property that's missing in the plugin. this causes typescript errors when trying to use the admin plugin with the updated library
Stripe Plugin | Bugs To Fix
"@better-auth/stripe": "^1.2.1",
"better-auth": "^1.2.1",
"@better-auth/stripe": "^1.2.1",
"better-auth": "^1.2.1",

mapProfileToUser doesn't work when using ID token authentication
Hi, great work on Better Auth!
When using ID tokens to log in into a sign in provider (e.g. Google with ID token and access token, as aspecified here ),
mapProfileToUser
parameters are not passed to the user object, thus not being stored in the database neither.
I've set up additionalAttributes on the user object. If those are required, Prisma complains about those parameters not being specified while creating the user object. If those are not required they are just left as null
Backend auth.ts
...Social Login state mismatch error
I migrated to v 1.2 and this broke the apple and google logins for my site. I couldn't figure out what exactly was wrong as the oauth flow wasn't completing successfully. I got this logs in my server `this is the server error logs 2025-03-03T06:39:36: ^[[2m2025-03-03T06:39:36.790Z^[[0m ^[[31mERROR^[[0m ^[[1m[Better Auth]:^[[0m State Mismatch. Verification not found { stat>
2025-03-03T06:39:36: # SERVER_ERROR: TypeError: Cannot read properties of undefined (reading 'get')
2025-03-03T06:39:36: at <unknown> (.next/server/chunks/903.js:299:18339)
2025-03-03T06:39:36: at Object.r [as handler] (.next/server/chunks/903.js:84:105326)
2025-03-03T06:39:36: at async y (.next/server/chunks/903.js:84:93446)...
Solution:
This has been solved in 1 2.3
twoFactor.verifyTotp missing trustDevice: true
I’m a little bit confused about trustDevice: true.
It works with:
twoFactor.verifyOtp
...
Auto Cleanup for expired verification data - fails on D1 (also sqlite?)
Using better-auth on Cloudflare D1. Since updating to better-auth 1.2, authentication fails with errors as follows:
```
(log) Query: delete from "auth_verifications" where "auth_verifications"."expiresAt" = ? -- params: ["2025-03-02T14:23:00.936Z"]
(error) # SERVER_ERROR: Error: D1_TYPE_ERROR: Type 'object' not supported for value 'Sun Mar 02 2025 14:23:00 GMT+0000 (Coordinated Universal Time)'...
Fixed menu header links not visible on mobile
It is a small styling issue but when scrolling to the bottom and opening the menu, the links are not displayed. You need to open the menu at the top of the page and then the links remain fixed and are visible.
Stripe Plugin | Webhook Event Failure
Upon testing extensively, it appears the cancellation functionality of the plugin doesn't work at all.
```
2025-03-02 01:54:13 <-- [200] POST http://localhost:3000/api/auth/stripe/webhook [evt_1Qy1jMFPuZ6ftAZV4fTCVBhl]
2025-03-02 01:54:13 --> customer.subscription.deleted [evt_1Qy1jMFPuZ6ftAZVi3u38WYV]...

V1.2.0: ERR_PACKAGE_PATH_NOT_EXPORTED
```
node:internal/modules/run_main:122
triggerUncaughtException(
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './node' is not defined by "exports" in /Users/user/Workspace/app/node_modules/better-auth/node_modules/better-call/package.json imported from /Users/user/Workspace/app/node_modules/better-auth/dist/integrations/node.mjs...
Secure cookie prefix
Shouldnt the logic to determine the
__Secure-
prefix be the same for all 3 cookie methods in https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/cookies/index.ts ?
If I understand it correctly, only the createCookie function takes into account the advanced?.useSecureCookies and baseURL.startsWith("https://") part.
I'm debugging a problem where "everything" worked until I added the next middlewara that uses getSessionCookie. This returns null for me. I'm using https locally but also tried to set advanced.useSecureCookies=true
. So my cookies have the Secure prefix as expeced...."/api/auth/*" rule fails on express ^5.0.0
Express changed their handling of wildcards in 5.0.0. This results in the * to do something else than intended by better auth. Maybe you could add a note in the docs or add the correct way of handling new express versions
Better-auth cannot be set up using pg Pool and postgres
It seems somewhere in the code there's hardcoded user relation when trying to set up:
database: new Pool({
connectionString: process.env.DATABASE_URL,
}),
tables: {...
Getting a 404 on useSession and unable to use Svelte Store
Hi there,
When making a request to: api/auth/use-session I am recieving a 404. This is made to a
Honojs
backend.
Then on the Svelte
side when I try use the store or value from the useSession method it is saying it is not a store
.
...