Commit Graph

3820 Commits

Author SHA1 Message Date
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
KinfeMichael Tariku
76c90f2e59 chore: fix memebrship limit js doc (#3534) 2025-07-21 20:16:48 -07:00
Bereket Engida
6d84138c80 docs: fix installtion guide in dodopayments 2025-07-21 20:12:59 -07:00
Danny
452069aed9 fix: issue when setting rate limit storage with a different model name (#3536)
The `set` function of `createDbStorage` is referencing a hardcoded string 'rateLimit'. This causes an error when a custom name for the model has been used:

```
TypeError: Cannot read properties of undefined (reading 'fields')
``` 

It should use the model the `get` method uses which reads `modelName` if it has been specified.

This change fixes the error locally for me.
2025-07-21 20:01:01 -07:00
Ayush Agarwal
23f142e4b6 docs: added dodo payments plugin (#3468)
* docs: added dodo payments better auth adapter docs

* cleanup

* cleanup

* cleanup

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-21 19:54:04 -07:00
Bereket Engida
fa9b497370 chore: release v1.3.2 v1.3.2 2025-07-20 22:19:21 -07:00
KinfeMichael Tariku
bc88ade07c fix: improve setting active org performance (#3497) 2025-07-20 22:18:01 -07:00
Bereket Engida
4fa11b4f3f chore: export siwe typesVersion 2025-07-20 22:15:26 -07:00
Bereket Engida
e8d291affe chore: add SIWE plugin export 2025-07-20 22:14:48 -07:00
KinfeMichael Tariku
5a66317c53 chore: fix auth type (#3510) 2025-07-20 22:09:54 -07:00
Charlie ✨
f8caeb9185 docs: add NuxtOne link as example integration with Nuxt (#3492) 2025-07-20 22:09:24 -07:00
Saurabh
9abf1165b8 docs: update SvelteKit installation (#3506) 2025-07-20 16:24:33 -07:00
TheUntraceable
02ae10ca43 docs: fix typo in organization invitation docs (#3508)
* Fix typo in organization invitation docs

* Fix typo in code for invitations
2025-07-20 16:23:11 -07:00
Bereket Engida
99460c6325 chore: release v1.3.1 v1.3.1 2025-07-19 19:32:20 -07:00
Bereket Engida
99f5f53927 chore: release v1.3.1 2025-07-19 19:32:05 -07:00
Bereket Engida
3b802587f3 fix(organization): multi teams breaking active organization id type inference (#3491)
* fix(organization): multi teams breaking active organization id type inference

* fix: type
2025-07-19 19:12:51 -07:00
Bereket Engida
8a8d876a7c chore: remove unused code 2025-07-19 18:25:12 -07:00
Bereket Engida
3a824f9660 docs: remove border from blog 2025-07-19 18:19:47 -07:00
Dagmawi Babi
adee10d522 docs: better blog preview (#3489) 2025-07-19 17:39:17 -07:00
Bereket Engida
84a8af814e docs: fix hero light mode 2025-07-19 16:14:38 -07:00