Commit Graph
4400 Commits
Author SHA1 Message Date
Bereket Engida 422e5bf4f5 Merge remote-tracking branch 'origin/main' into v1.3 2025-06-27 23:37:12 -07:00
MaxwellandGitHub 0b03431eae fix(create-adapter): doesn't work with mongoAdapter (#3203)
* fix(create-adapter): doesn't work with monogAdapter

In Better-auth, we do not allow customising IDs, so nothing takes into account of "different ids".
However MongoDB requires ids to be different.

The `getDefaultFieldName` fn in the create-adapter doesn't take into account that IDs from Mongo are not the same as the normal `id`. This is a patch fix until proper resolve is implemented.

* chore: lint

* chore: cleanup
2025-06-27 23:24:46 -07:00
Bereket Engida 5f76b0416f chore: release v1.3.0-beta.2 2025-06-27 22:59:23 -07:00
Bereket Engida 002cacbf2a Merge remote-tracking branch 'origin/main' into v1.3 2025-06-27 22:57:26 -07:00
MaxwellandGitHub de39373415 chore: add tests for create-adapter to not include an id when generate id is disabled (#2423)
* add: tests for create-adapter to not include an id when generate id is disabled

* chore: minor improvements
2025-06-27 22:55:48 -07:00
MaxwellandGitHub 557793b183 docs(organization): update description for getActiveMember function (#2555)
Refined the description to clearly convey that the function retrieves member details of the active organization.
2025-06-27 22:55:23 -07:00
MaxwellandGitHub c13d1867a8 fix(create-adapter): transformWhere should account for customTransformInput (#2437) 2025-06-27 22:55:02 -07:00
MaxwellandGitHub 3119cadf0d fix(create-adapter): getModelName should apply plural to custom model names (#3084)
Fixes https://github.com/better-auth/better-auth/issues/3069#issuecomment-2985270520
2025-06-27 22:53:46 -07:00
Bereket Engida df987c166e chore: release v1.3.0-beta.1 2025-06-27 22:37:44 -07:00
MaxwellandGitHub 2a36760653 fix(email-otp): doesn't call onEmailVerification (#2974) 2025-06-27 22:06:16 -07:00
Bereket EngidaandGitHub c1d4f467ff fix(account): add placeholder URL for type inference in linkSocialAccount response (#3199) 2025-06-27 20:22:16 -07:00
Bereket Engida fece011149 chore: release v1.2.11 2025-06-27 20:21:54 -07:00
+6 a6a66d9c7e feat: SSO plugin with OIDC and SAML support (#3185)
* fix(email-verification): improve email verification logic to check session and user email consistency (#3042)

* docs(passkey): Fixed signIn passkey props (#3014)

callbackURL doesn't exist.

* fix(email-otp): auto-verify on email otp reset (#3022)

* fix: delete user should respect freshAge config (#3075)

* fix: delete user needs to enforced through fresh age

* cleanup

* cleanup

* chore(org): add comments explaining what shimContext does (#3098)

* feat: Allow passing `id` in DB hook `create` (#3048)

* feat(database-hooks): Allow passing `id` in DB hook `create`

It's the same to using a custom `idGenerator`, except configurable by the database hook which would in theory provide more data.

A use-case is to generate the id based on user info in the user before DB hook.

Solves https://discord.com/channels/1288403910284935179/1379190465588367540/1384217435535835216

* chore: lint

* fix: tests failing

* docs: basic errs with svg props (#3102)

* docs: corrected github user email scope name (#3099)

* docs: corrected github user email scope name

* docs: cubic dev suggestion

* fix: use correct refresh token endpoint for github (#3095)

* chore: fix typo in authorize comment (#3106)

* docs: fix session parameter spelling (#3108)

* docs: input field usage on additional fields (#2991)

* fix: onLinkAccount trigger on phone number verification (#3007)

* fix: expose headers override in jwt plugin (#3019)

* expose headers override in jwt plugin

* clean up

* lint

* fix(expo): remove duplicated trusted origins

* feat: link account with idToken  (#1830)

* add idToken to link account

* add docs

* Implemented linking accounts based on idToken

* fix: tests

* docs: prevent diff

* docs: prevent diff

---------

Co-authored-by: kzlar <120426485+kzlar@users.noreply.github.com>

* feat: add Hugging Face provider (#3089)

* feat: add huggingface provider

* Add hugging face to doc

* chore: update hugging face logo

* chore: release v1.2.10

* docs: fix builder failing to open

* docs(NextJS): Improve middleware example to be more secure (#3135)

* docs(NextJS): Improve middleware example to be more secure

Users can skim code without reading the text, and LLMs can read code and miss-understand context correctly.  Our current middleware example only checks for existence of a cookie, and doesn't validate it.

While we do warn users this isn't secure, some users has raised concern in a Github issue saying it's not obvious enough for users who skim.

Also we don't provide examples on how to authenticate users on each route, we only show middleware optimistic check examples.

* Update docs/content/docs/integrations/next.mdx

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

---------

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

* fix(username): log the correct username (#3127)

* docs: fix typo in plugin (#3122)

* typo

* typo

* typo

* typo

* typo

* docs: fix typos on mcp guide (#3146)

* docs: update TanStack Start integration guide (#3142)

* fix(sveltekit): only dynamic import $app/environment once (#3152)

Co-authored-by: Work <work@Jasons-MacBook-Pro.local>

* docs: fix typo in oauth proxy documentation (#3151)

* blog: seed round announcement  (#3168)

* init

* cleanup

* fix seed round announcemnt

* fix seed round announcemnt

* seed round blog

* add nav mobile

* fix typo

* Update docs/content/blogs/seed-round.mdx

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

* Update docs/app/blog/[[...slug]]/page.tsx

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

* Update docs/app/blog/[[...slug]]/page.tsx

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

* update og

* cleanup

---------

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

* docs: fix email address

* refactor(mongo-adapter): migrate to createAdapter (#3170)

In the past we didn't have mongoDb adapter move over to createAdapter since we've seen users running into issues.

However some time ago I've merged a PR which I believe fixed the issue, and after testing the org plugin with the mongo adapter that uses `createAdapter` I don't see any issues.

* fix(api-key): update should only use by ID

* docs: fix blog page layout (#3176)

* fix/blog-page-layouts

* clean up

* docs: update contact email in seed round blog

* init

* cleanup

* feat(better-auth): add test utilities and update dependencies

- Introduced a new test utility module in `src/test-utils/index.ts` for better testing support.
- Updated `package.json` to include new test utilities in the build configuration.
- Added `oauth2-mock-server` dependency to `pnpm-lock.yaml` and `sso/package.json` for OAuth2 testing.
- Enhanced the SSO provider registration process with improved error handling.

* docs update

---------

Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: Undefined Ninja <74867549+0xCodeMaieutics@users.noreply.github.com>
Co-authored-by: artemoire <18062266+artemoire@users.noreply.github.com>
Co-authored-by: reslear <12596485+reslear@users.noreply.github.com>
Co-authored-by: kzlar <120426485+kzlar@users.noreply.github.com>
Co-authored-by: Eliott C. <coyotte508@protonmail.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Alessandro Bortolin <bortolin.alessandro@outlook.it>
Co-authored-by: Lakshya Thakur <lapstjup@gmail.com>
Co-authored-by: Usman S. (Max Programming) <51731966+max-programming@users.noreply.github.com>
Co-authored-by: Jason Venable <jason.venable@gmail.com>
Co-authored-by: Work <work@Jasons-MacBook-Pro.local>
Co-authored-by: Dan McGrath <daniel.mcgrath9@gmail.com>
2025-06-27 20:19:19 -07:00
Tai VoandGitHub 0679ebed3e chore: update jose to fix vite build (#3183) 2025-06-27 11:26:23 -07:00
Bereket Engida ebde893b1c fix(user-card): refactor email verification button and update trusted origins 2025-06-27 11:22:43 -07:00
KinfeMichael TarikuandGitHub 58919f8543 fix(api-key): update should only use by ID 2025-06-25 22:57:49 -04:00
MaxwellandGitHub e65125da8d refactor(mongo-adapter): migrate to createAdapter (#3170)
In the past we didn't have mongoDb adapter move over to createAdapter since we've seen users running into issues.

However some time ago I've merged a PR which I believe fixed the issue, and after testing the org plugin with the mongo adapter that uses `createAdapter` I don't see any issues.
2025-06-25 22:31:52 -04:00
Bereket EngidaGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
1d35c64e6b blog: seed round announcement (#3168)
* init

* cleanup

* fix seed round announcemnt

* fix seed round announcemnt

* seed round blog

* add nav mobile

* fix typo

* Update docs/content/blogs/seed-round.mdx

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

* Update docs/app/blog/[[...slug]]/page.tsx

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

* Update docs/app/blog/[[...slug]]/page.tsx

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

* update og

* cleanup

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-06-25 12:32:01 -04:00
5bdf3c0ec1 fix(sveltekit): only dynamic import $app/environment once (#3152)
Co-authored-by: Work <work@Jasons-MacBook-Pro.local>
2025-06-24 18:28:25 -04:00
Alessandro BortolinandGitHub 8137b37056 fix(username): log the correct username (#3127) 2025-06-22 16:16:07 -07:00
Bereket Engida 08d92952ab chore: release v1.2.10 2025-06-20 15:05:19 -07:00
Eliott C.andGitHub 6304efa8f0 feat: add Hugging Face provider (#3089)
* feat: add huggingface provider

* Add hugging face to doc
2025-06-20 15:01:29 -07:00
38e422e4c4 feat: link account with idToken (#1830)
* add idToken to link account

* add docs

* Implemented linking accounts based on idToken

* fix: tests

* docs: prevent diff

* docs: prevent diff

---------

Co-authored-by: kzlar <120426485+kzlar@users.noreply.github.com>
2025-06-20 15:01:06 -07:00
4e38645b44 feat: sveltekit cookie helper plugin (#3049)
* fix(email-verification): improve email verification logic to check session and user email consistency (#3042)

* docs(passkey): Fixed signIn passkey props (#3014)

callbackURL doesn't exist.

* feat: svelte kit cookie helper

* lint

* docs and clean up

* clean up

* lint

* clean up

* clean up

* sync cookies

* lint

* pruning

* pruning and lint

* update

* update

* update

---------

Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
2025-06-20 13:47:26 -07:00
Bereket Engida 9801d1be53 fix(expo): remove duplicated trusted origins 2025-06-20 13:43:38 -07:00
KinfeMichael TarikuandGitHub de6b53ce4e fix: expose headers override in jwt plugin (#3019)
* expose headers override in jwt plugin

* clean up

* lint
2025-06-20 13:32:15 -07:00
KinfeMichael TarikuandGitHub 88573aa9dc fix: onLinkAccount trigger on phone number verification (#3007) 2025-06-20 13:10:46 -07:00
Bereket EngidaandGitHub 7eded3da8a chore: fix typo in authorize comment (#3106) 2025-06-20 12:24:12 -07:00
artemoireandGitHub 1b0aef5be3 fix: use correct refresh token endpoint for github (#3095) 2025-06-20 11:50:49 -07:00
MaxwellandGitHub 9714131eaf feat: Allow passing id in DB hook create (#3048)
* feat(database-hooks): Allow passing `id` in DB hook `create`

It's the same to using a custom `idGenerator`, except configurable by the database hook which would in theory provide more data.

A use-case is to generate the id based on user info in the user before DB hook.

Solves https://discord.com/channels/1288403910284935179/1379190465588367540/1384217435535835216

* chore: lint

* fix: tests failing
2025-06-20 08:25:42 -07:00
MaxwellandGitHub f12e345beb chore(org): add comments explaining what shimContext does (#3098) 2025-06-20 07:39:40 -07:00
Bereket EngidaandGitHub 7c728248dc fix: delete user should respect freshAge config (#3075)
* fix: delete user needs to enforced through fresh age

* cleanup

* cleanup
2025-06-18 21:20:52 -07:00
KinfeMichael TarikuandGitHub fd62eba1d0 fix(email-otp): auto-verify on email otp reset (#3022) 2025-06-16 13:51:41 -07:00
MaxwellandGitHub be3face70c feat(username): Check username availability (#3025)
* feat(username): Check username availability

closes https://github.com/better-auth/better-auth/issues/1553

* add: docs
2025-06-16 00:24:57 -07:00
Bereket EngidaandGitHub 482c99f246 fix(email-verification): improve email verification logic to check session and user email consistency (#3042) 2025-06-15 23:22:03 -07:00
KinfeMichael TarikuandGitHub 93d5bbe04d fix: expose-headers override in bearer plugin when setting set-auth-token (#3029)
* fix: bearer override headers

* clean up
2025-06-15 15:43:52 -07:00
Bereket EngidaandGitHub c7f8be1c72 fix: duplicate oauth registration (#3038)
* fix: duplicate oauth registration

* revert to checking account id instead
2025-06-15 15:33:31 -07:00
526c9372fa fix: always use custom errorURL when available (#2640)
* Use custom errorURL when available

* fix oidc

---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
2025-06-15 15:09:20 -07:00
Tim EtlerandGitHub 0df8793f5f fix: deleteUser check session freshAge using ms instead of sec (#3020) 2025-06-15 12:51:20 -07:00
Bereket Engida 4ae34800f8 fix: remove active organization when member isn't found 2025-06-15 12:44:33 -07:00
JafriandGitHub 2b46191017 fix: incremental scopes for Microsoft and return all granted scopes for Google (#3013) 2025-06-15 09:17:41 -07:00
MaxwellandGitHub 015ba5632b feat(organization): maximumMembersPerTeam support (#2374)
* feat(organization): maximumMembersPerTeam support

Allow configuration of maximum number of members allowed in a team.

* chore: cleanup
2025-06-14 15:14:16 -07:00
MaxwellandGitHub 475472c971 fix(get-session): missing null type on /get-session when throw:true is set (#3026)
* fix(get-session): missing `null` type on /get-session

When there isn't an active session, `null` is returned on the `/get-session` endpoint.
This was missing in types.

* chore: fix type errors
2025-06-14 14:41:41 -07:00
KinfeMichael TarikuandGitHub e27d77a68f fix: propagate a secondary storage updates on updated user (#3000)
* update user propagate update on session with secondary storage

* lint

* descriptive
2025-06-13 23:02:48 -07:00
Tai VoandGitHub 552ea8a041 feat(cli): allow cli to use custom adapter createSchema if implemented (#3006)
* the cli now uses createSchema from custom adapters

* rename function misnomer and keep old name as deprecated
2025-06-13 16:59:00 -07:00
Rohit MenonandGitHub 6fcce5e6d1 fix(twitter): update email verification logic in profile mapping (#3005) 2025-06-12 21:31:39 -07:00
Bereket Engida fe6a585f46 chore: release v1.2.10-beta.1 2025-06-12 21:09:34 -07:00
Julius MarmingeandGitHub aedf7a36a0 fix(oauth-proxy): resolve current URL with precedence (#2998)
* better resolve url

* rm unused

* use an actual base type
2025-06-12 10:24:38 -07:00
42e4fd728a fix(organization): organization with no members error (#2999)
* fix: handle empty userIds in getOrgAdapter to prevent errors

* refactor: remove unnecessary whitespace in getOrgAdapter function

* refactor: simplify user fetching logic in getOrgAdapter function

---------

Co-authored-by: Sean Luca Krüger <mail@seanlucakrueger.de>
2025-06-12 10:23:26 -07:00
matteovavaandGitHub c91c6830d4 fix: support "ne" (not equal) filter in Prisma adapter (#2993) 2025-06-11 20:31:45 -07:00