Commit Graph

3839 Commits

Author SHA1 Message Date
Chase
e4af2530f0 fix: twitter refresh token requires basic authentication (#3652)
* Use basic auth for refreshing token

* change set
2025-07-27 13:13:59 -07:00
Marcel Losso Forte
e7af3aa80c docs: typo and wrong ref for additional fields in Email & Password page (#3639) 2025-07-26 20:15:54 -07:00
Bereket Engida
a536de91c2 fix(stripe): update customer id should also trigger secondary storage update (#3635)
* fix: update customer id should also update secondary storage

* chore: add changeset
2025-07-26 12:07:55 -07:00
Bereket Engida
8fdcf54a7b docs: fix account deletion process for OAuth users 2025-07-26 11:47:24 -07:00
KinfeMichael Tariku
23d6f30b41 chore: ensure zod version alignment via peerDependency (#3619)
* zodv4

* fix

* lock

* pkg

---------

Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-07-26 09:02:54 -07:00
Bereket Engida
02f19810d6 chore(release): version packages @better-auth/cli@1.3.4 @better-auth/expo@1.3.4 @better-auth/sso@1.3.4 @better-auth/stripe@1.3.4 better-auth@1.3.4 2025-07-26 01:10:54 -07:00
Bereket Engida
776c4ae3fe chore(release): version packages (#3623)
* chore(release): version packages

* chore: remove lock file

* chore: fix ci

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-26 00:56:29 -07:00
Bereket Engida
2b2fd0c77d chore: fix ci 2025-07-26 00:35:37 -07:00
Bereket Engida
2bd2fa9864 chore: add changeset 2025-07-26 00:35:37 -07:00
Bereket Engida
be544ce355 chore: release v1.3.4-beta.3 2025-07-26 00:35:37 -07:00
Shawn Erquhart
5bfabed2b2 fix: cast dates from db to Date when using date methods (#3611)
* docs(api-key): move schema section to the bottom

* fix: shouldn't refresh a token if access token expires is undefined or null (#3577)

* fix: ensure session is added to context when reading from cookie cache (#3578)

When session data is present in the cookie, `get-session` was
early-returning without adding the session to the context, causing hooks
to receive a null session.
This change ensures the session is consistently added to the context.

* chore: export siwe in better-auth/plugins (#3596)

The docs were using this import path, yet `siwe` wasn't exported there. This PR fixes this.

* chore: fix cookies test

* docs: make client-side vs. server-side explicit (#3603)

* docs: fix broken link to ERC-4361 in siwe docs (#3604)

* fix(jwt): ensure alg is added to the jwks when generating via /token endpoint (#3601)

* fix: Ensure alg is added to the jwks when generating via /token endpoint

* chore: resolve linting issues

* fix: cast dates from db to Date when using date methods

* fix lint

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: Gagan G <80091397+gaganref@users.noreply.github.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: Justin <127172022+jl33-ai@users.noreply.github.com>
Co-authored-by: Fraol Lemecha <fraol0912@gmail.com>
Co-authored-by: Elliott Minns <elliott.minns@pm.me>
2025-07-26 00:35:37 -07:00
Bereket Engida
8a50ac4b0c chore: improve client inference for organization additional fields (#3612)
* docs(api-key): move schema section to the bottom

* fix: shouldn't refresh a token if access token expires is undefined or null (#3577)

* fix: ensure session is added to context when reading from cookie cache (#3578)

When session data is present in the cookie, `get-session` was
early-returning without adding the session to the context, causing hooks
to receive a null session.
This change ensures the session is consistently added to the context.

* chore: export siwe in better-auth/plugins (#3596)

The docs were using this import path, yet `siwe` wasn't exported there. This PR fixes this.

* chore: fix cookies test

* fix: client inference for organization additional fields

* improve additional fields

* fix build

* fix test

---------

Co-authored-by: Gagan G <80091397+gaganref@users.noreply.github.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2025-07-26 00:35:37 -07:00
Bereket Engida
fbff0e8781 chore: release v1.3.4-beta.2 2025-07-26 00:35:37 -07:00
Bereket Engida
847ee881d6 docs: add list member 2025-07-26 00:35:37 -07:00
Bereket Engida
e8b3d2c26b feat: list organization memebrs with pagination and filter queries (#3581)
* docs(api-key): move schema section to the bottom

* fix: shouldn't refresh a token if access token expires is undefined or null (#3577)

* fix: ensure session is added to context when reading from cookie cache (#3578)

When session data is present in the cookie, `get-session` was
early-returning without adding the session to the context, causing hooks
to receive a null session.
This change ensures the session is consistently added to the context.

* feat(organization): add membersLimit param to allow to fetch more or less members than the membership limit

* add test

* Update packages/better-auth/src/plugins/organization/adapter.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* feat(organization): add list members with pagination and filter

* chore: lint

* cleannup

---------

Co-authored-by: Gagan G <80091397+gaganref@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-26 00:35:37 -07:00
Bereket Engida
518ab70495 feat(organization): add membersLimit param to allow to fetch more or less members than the membership limit (#3580)
* docs(api-key): move schema section to the bottom

* fix: shouldn't refresh a token if access token expires is undefined or null (#3577)

* fix: ensure session is added to context when reading from cookie cache (#3578)

When session data is present in the cookie, `get-session` was
early-returning without adding the session to the context, causing hooks
to receive a null session.
This change ensures the session is consistently added to the context.

* feat(organization): add membersLimit param to allow to fetch more or less members than the membership limit

* add test

* Update packages/better-auth/src/plugins/organization/adapter.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Gagan G <80091397+gaganref@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-26 00:35:37 -07:00
KinfeMichael Tariku
7f508f0d22 fix: resolve notion oauth user info extraction (#3567) 2025-07-26 00:35:37 -07:00
Bereket Engida
09ef0110a9 chore: release v1.3.4-beta.1 2025-07-26 00:35:37 -07:00
Maxwell
a83cf9847b feat(organization): additional fields support separate client-server projects (#3564) 2025-07-26 00:35:37 -07:00
PacifismPostMortem
a9c190898d fix: use same expires at date for cookie session data payload and signature (#3283)
* fix: use same expires at date for cookie session data payload and signature

* chore: lint

---------

Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-26 00:19:42 -07:00
Bereket Engida
976c05a9ca chore: add github access token for changeset 2025-07-25 21:59:48 -07:00
Bereket Engida
7093503ffd chore: use github access token for release workflow 2025-07-25 21:52:29 -07:00
Bereket Engida
1eeff038b3 chore: add codeowners 2025-07-25 21:30:05 -07:00
Bereket Engida
ca1092db77 chore: add write permission for release workflow 2025-07-25 21:25:21 -07:00
Bereket Engida
a9806e5704 chore: add changeset-version cli 2025-07-25 21:15:16 -07:00
Bereket Engida
39e4910021 chore: remove tag version check from release workflow 2025-07-25 21:08:26 -07:00
Bereket Engida
5e93871662 chore: add owner check for release workflow 2025-07-25 21:06:27 -07:00
Bereket Engida
a05e67d5e1 chore: update release workflow 2025-07-25 21:04:17 -07:00
Bereket Engida
2fbf83ece5 chore: update release workflow 2025-07-25 21:02:57 -07:00
Bereket Engida
c2fb1aa316 fix(stripe): prevent duplicate trials when switching plans (#3622)
* fix(stripe): tiral subscription should use update flow

* add changelog

* chore: changeset
2025-07-25 20:53:03 -07:00
Fraol Lemecha
ac6baba2a0 chore: add changesets (#3557)
* chore: consistent package names

* chore: init changesets

* chore: update contribution doc to include generating a changeset

* chore: configure all better auth packages to always have the same version number

* chore: update nextjs demo package name

* chore(changesets): ignore all private packages

* chore(changesets): check for changesets in CI

* chore(changesets): install chagesets cli

* chore(changesets): use orgin as main

* chore(changesets): fix typo

* chore(changesets): check for changes since main in ci

* chore(changesets): check for changes since main in ci with the correct command

* chore(changesets): check against `origin/main`

* chore(changesets): checking for changesets should be the last action

* chore(changesets): run changelog check after stoping the docker containers

* chore(changesets): run changelog check after building

* chore(changesets): run changelog check after starting docker compose

* chore(changesets): run changelog check after linting

* chore(changesets): run changelog check after testing

* Revert "chore(changesets): run changelog check after testing"

This reverts commit 6dc000f78d.

* chore: export siwe in better-auth/plugins (#3596)

The docs were using this import path, yet `siwe` wasn't exported there. This PR fixes this.

* chore: fix cookies test

* docs: make client-side vs. server-side explicit (#3603)

* docs: fix broken link to ERC-4361 in siwe docs (#3604)

* fix(jwt): ensure alg is added to the jwks when generating via /token endpoint (#3601)

* fix: Ensure alg is added to the jwks when generating via /token endpoint

* chore: resolve linting issues

* chore(example): fix SvelteKit example (#1742)

* refactor: upgrade Svelte, Vite and related packages

* refactor: replace no longer supported `body.callbackURL` with `onSuccess`

* fix: add missing `svelte-kit sync` on `prepare`

* fix: add missing `import`s

* chore(svelte-kit-example): show message & redirect to index after sign up

* chore: add npm script to migrate database

* doc: add more commands to set up

* chore: explicitly disable verification email on sign up

The example does not work if you set `sendOnSignUp: true` without setting up the email server.

* refactor(svelte-kit-example): add type for hooks

* chore(svelte-kit-example): redirect to sign in page if users open dashboard without log in

* chore: diable some rules for svelte-kit-example due to Biome's limited Svelte support

* style: fix format

* chore: update pnpm-lock.yaml

* chore: fix lock file

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>

* fix: make sveltekit plugin ALS-agnostic (#3533)

* svelte cookie

* udpate

* update

* update

* update

* chore(cli): update zod to v4 (#3618)

* fix: correct typo in freeTrial variable name in Stripe integration

* chore: fix lock file

* chore: add changeset for typo fix in freeTrial

---------

Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Justin <127172022+jl33-ai@users.noreply.github.com>
Co-authored-by: Elliott Minns <elliott.minns@pm.me>
Co-authored-by: Jumpei Ogawa <git@phanective.org>
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
2025-07-25 20:39:44 -07:00
KinfeMichael Tariku
aba8f7f04d chore(cli): update zod to v4 (#3618) 2025-07-25 16:59:06 -07:00
KinfeMichael Tariku
b5a4c3fc78 fix: make sveltekit plugin ALS-agnostic (#3533)
* svelte cookie

* udpate

* update

* update

* update
2025-07-25 15:07:28 -07:00
Jumpei Ogawa
40cefe99b1 chore(example): fix SvelteKit example (#1742)
* refactor: upgrade Svelte, Vite and related packages

* refactor: replace no longer supported `body.callbackURL` with `onSuccess`

* fix: add missing `svelte-kit sync` on `prepare`

* fix: add missing `import`s

* chore(svelte-kit-example): show message & redirect to index after sign up

* chore: add npm script to migrate database

* doc: add more commands to set up

* chore: explicitly disable verification email on sign up

The example does not work if you set `sendOnSignUp: true` without setting up the email server.

* refactor(svelte-kit-example): add type for hooks

* chore(svelte-kit-example): redirect to sign in page if users open dashboard without log in

* chore: diable some rules for svelte-kit-example due to Biome's limited Svelte support

* style: fix format

* chore: update pnpm-lock.yaml

* chore: fix lock file

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-25 13:32:17 -07:00
Elliott Minns
f99305b29e fix(jwt): ensure alg is added to the jwks when generating via /token endpoint (#3601)
* fix: Ensure alg is added to the jwks when generating via /token endpoint

* chore: resolve linting issues
2025-07-24 23:28:11 -07:00
Fraol Lemecha
eb0207f03e docs: fix broken link to ERC-4361 in siwe docs (#3604) 2025-07-24 23:26:04 -07:00
Justin
f27a579169 docs: make client-side vs. server-side explicit (#3603) 2025-07-24 23:25:12 -07:00
Bereket Engida
68f09f15d3 chore: fix cookies test 2025-07-24 15:21:47 -07:00
Maxwell
59ea6c9d79 chore: export siwe in better-auth/plugins (#3596)
The docs were using this import path, yet `siwe` wasn't exported there. This PR fixes this.
2025-07-24 12:27:54 -07:00
Gagan G
01814c55e0 fix: ensure session is added to context when reading from cookie cache (#3578)
When session data is present in the cookie, `get-session` was
early-returning without adding the session to the context, causing hooks
to receive a null session.
This change ensures the session is consistently added to the context.
2025-07-23 22:07:30 -07:00
Bereket Engida
4d7676d8d9 fix: shouldn't refresh a token if access token expires is undefined or null (#3577) 2025-07-23 21:46:02 -07:00
Bereket Engida
c83b23c6ba docs(api-key): move schema section to the bottom 2025-07-23 21:16:22 -07:00
Khiet Tam Nguyen
e11c51e210 feat(cli): added --yes for generate/migrate, deprecated --y (#3542)
* feat(cli): added --yes option, deprecated --y, as per #1937

* feat:(cli): add deprecation warning to console if --y is used

* style(cli): linted migrate.ts & generate.ts

* docs(cli): revert 1.0 changelog
2025-07-23 09:31:06 -07:00
Bereket Engida
602ab7c4c6 chore: release v1.3.3 v1.3.3 2025-07-22 23:02:47 -07:00
Bereket Engida
a1cdb8b115 fix(organization): list organization teams should prioritize query param team id(#3531)
* fix: list organization teams

* Update packages/better-auth/src/plugins/organization/routes/crud-team.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* add request check

* fix list team members

* add desc

* fix: fetch session

* update

* only allow fetching using userid when request doesn't exist

* requrie session

* remove org id

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-22 23:02:31 -07:00
Bereket Engida
7de38cb68a fix(stripe): revert a change where incomplete stripe session is getting updated to active on upgrade (#3554) 2025-07-22 22:59:36 -07:00
Jakob Norlin
c5fdfa6264 chore: export types from organization plugin (#3546) 2025-07-22 19:32:55 -07:00
Nate Tewelde
52695f0280 fix(sso): include mapping inside samlConfig payload (#3548) 2025-07-22 18:22:07 -07:00
Bereket Engida
dea6419e09 feat(sso): support disabling setting email verified from a provider (#3551)
* feat: support disabling setting email verified

* Update docs/content/docs/plugins/sso.mdx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix: update account handling in SSO to support trusted providers

* default to not setting email verified

* docs: update documentation

* add attribute map

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-22 18:19:25 -07:00
Danny
8fbe8f03a5 chore: model name needs to be default name (#3538)
I was mistaken a [previous fix](452069aed9), it just moved the error.

This value should be the default model name to match [transformInput](76c90f2e59/packages/better-auth/src/adapters/create-adapter/index.ts (L324)) schema lookup.

The schema looks like this
```
{
   ...
        rateLimit: {
          modelName: 'rateLimits',
          fields: {
            key: [Object],
            count: [Object],
            lastRequest: [Object],
            id: [Object]
          }
        }
      }
```

Matching on the default name returns the correct schema.

This test is now passing locally a different rateLimiter model. 

```
            it ( "should hit rate limit on forth login attempt within 10s", async () => {

                for ( let i = 0; i < 3; i++ ) {

                    const response = await request( testApp )
                        .post( usernameSignInPath )
                        .send( { username: testUsername, password: testPassword } );

                    expect( response.statusCode ).toEqual( 200 );

                }

                const res = await request( testApp )
                    .post( usernameSignInPath )
                    .send( { username: testUsername, password: testPassword } );

                expect( res.statusCode ).toEqual( 429 );
                expect( res.headers ).toHaveProperty( "x-retry-after" );

            } );
```
2025-07-21 23:09:03 -07:00