Commit Graph
132 Commits
Author SHA1 Message Date
Bereket EngidaandGitHub 066064b6b7 feat: support storing account data in a cookie (#6013) 2025-11-21 12:18:47 -08:00
Bereket EngidaandGitHub bb7723cc35 refactor: improved change email verification flow (#6088) 2025-11-19 08:24:43 +00:00
Bereket EngidaandGitHub 14128927b4 chore: upgrade to better-call to 1.2.28 (#6090) 2025-11-19 07:23:25 +00:00
MaxwellandGitHub 8c8b8a2fae chore: add missing customizeDefaultErrorPage docs (#6066) 2025-11-18 06:33:38 -08:00
MaxwellandGitHub f5bbb96d4e feat: adapter join support (#5730) 2025-11-15 16:55:50 +00:00
MaxwellandGitHub 9ce76beefc docs: document oauthConfig in options.mdx (#5947) 2025-11-13 20:09:06 +00:00
Bereket EngidaGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
4ac3476642 feat: add support for uuids (#5809)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-11-07 05:47:51 +00:00
Bereket EngidaandGitHub 8b3550951a fix: urls without protocol shouldn't be able to satisfy a wildcard origin (#5624) 2025-10-27 22:28:36 +00:00
2f671a9612 docs: update link to correct Better Auth options reference (#5534)
Co-authored-by: Alex Yang <himself65@outlook.com>
2025-10-26 06:01:51 +00:00
6ba15d5657 chore: refactor origin check middleware (#5411)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-19 05:13:44 +00:00
82de683552 fix: resolve custom URL scheme origin matching with wildcards (#5248)
Co-authored-by: antonvishal <antonvishal@appexert.com>
2025-10-15 02:29:50 +00:00
Edi SimetzbergerandGitHub 72d63b6e0f docs(options): fix redirectURI casing in socialProviders examples (#5156) 2025-10-09 15:51:53 +00:00
Alex YangandGitHub 0991bfe8aa test: add runWithDefaultUser helper (#4714) 2025-09-17 20:59:50 +00:00
Alex Yang cfcec1ae50 Merge branch 'canary' into v1.3.10-staging
# Conflicts:
#	packages/better-auth/package.json
#	packages/cli/package.json
#	packages/expo/package.json
#	packages/sso/package.json
#	packages/stripe/package.json
#	pnpm-lock.yaml
2025-09-15 08:51:27 -07:00
530767deeb feat(logger): option to disable colors (#4402)
Co-authored-by: Alex Yang <himself65@outlook.com>
2025-09-11 17:16:31 +00:00
Alex Yang d4bbb32910 Merge branch 'canary' into v1.3.8-staging
# Conflicts:
#	demo/nextjs/package.json
#	docs/package.json
#	packages/better-auth/package.json
#	pnpm-lock.yaml
2025-09-03 15:21:51 -07:00
MaxwellandGitHub 0ce6f3262e docs: improve wording (#4380) 2025-09-03 18:58:35 +10:00
KinfeMichael TarikuandGitHub 8c23eb0739 docs: add more resource videos (#4173) 2025-08-23 22:53:06 -07:00
Fraol LemechaGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
7b6f3fad8b fix: telemetry should be opt in not opt out (#4081)
* fix(telemetry): make telemetry opt in

* fix(telemetry): remove telemetry notice

* fix(docs): remove redundant "is"

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

* test(telemetry): opt in to telemetry in tests

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-19 10:28:58 -07:00
Bereket EngidaandGitHub d8a7630ae2 fix(telemetry): remove node imports for compatibility and add telemetry notice (#3942)
* remove fs imports

* fix: detect-sys-info

* add notice

* cleanup

* remove notice

* add notice

* remove postinstall

* update docs
2025-08-11 20:03:17 -07:00
KinfeMichael TarikuandGitHub f242400b1b docs: update missing links on contribution guide (#3922)
* docs: unify component implementations for consistency (#3799)

* fix(docs): unify component implementations for consistency

* update

* docs: contribution guide link

* lint
2025-08-11 14:09:07 +03:00
Bereket Engida a5bddf1675 chore: change examples url 2025-08-10 23:44:16 -07:00
+3 f363681f70 fix: remove deep array merge when merging hooks context (#3160)
* Update to-auth-endpoints.ts

fixed

* biome error

* first commit

* fix(org): use correct slug lookup when setting active org

* docs: adding reference to surrealdb adapter rewrite (#3754)

Adding reference to surrealdb adapter rewrite, with passing tests and schema generation as well as surreal native parameters.

* chore(demo): replace isLoading using `useTransition` (#3775)

* fix: use `useTransition` for isLoading

* fixup! fix: use `useTransition` for isLoading

* fix(reddit): refresh access token should use `basic` auth (#3753)

* reddit auth type

* changesets

* chore: remove changeset

---------

Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>

* docs: unify component implementations for consistency (#3799)

* fix(docs): unify component implementations for consistency

* update

* fix: add missing team reference in teamMember schema (#3801)

* fix(organization): team members should be cleaned up on delete team (#3833)

* feat(stripe): create billing portal session (#3625)

* feat(stripe) : add billing portal session endpoint

* create billing portal session

* update docs

* chore: changeset

* chore: fix stripe

* chore: remove comment

* chore: update docs

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>

* fix(cli): prisma schema generate mismatch on custom plugin table names (#3021)

* fix: generate mismatch

* clean up

* linkt

* lint

* clean up

* clean up

* lint

* lint

* test

* clean up

* clean up

* lint

* update

* docs: update TOTP 2FA docs to state that Better-Auth implements a delay window (#3586)

Better Auth uses a delay window for TOTP code verification to ensure that it is resilient to time delays

* docs: remove unused import of 'auth' type in authClient setup (#3856)

In the previous implementation, the import statement for 'auth' type from './auth' was included as part of the setup for the authClient, but it is no longer being used in the current code. This update removes the unnecessary import to clean up the code and prevent potential confusion.

Additionally, the authClient setup remains intact with the use of 'inferAdditionalFields' plugin to define additional user fields (role type set to 'string').

- Removed unused import: `import type { auth } from "./auth"`
- Kept the authClient initialization with 'inferAdditionalFields' plugin

This resolves a minor issue and ensures that the code remains clean and maintainable.

* docs: enhance trustedOrigins option with examples (#3857)

* docs: enhance trustedOrigins option documentation

* nit

* docs: fix typo in SSR performance section

The line was missing "the".

Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>

* chore: update api key docs (#3864)

Closes #3724

* docs: fix google auth prompt (#3894)

Google OAuth2 uses space delimiters instead of + 

https://developers.google.com/identity/protocols/oauth2/web-server

* docs(hono): update RPC client to use init config instead of custom fetch (#3597)

* add test

* chore: lint

---------

Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: Manuel Sanchez <manuel@msanchez.dev>
Co-authored-by: Alex Yang <himself65@outlook.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: dogus <147812199+rhitune2@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Hysterelius <71912794+Hysterelius@users.noreply.github.com>
Co-authored-by: Jovan Lanutan <jolanutan@gmail.com>
Co-authored-by: Nate <37544626+ntedvs@users.noreply.github.com>
Co-authored-by: Dagmawi Babi <44819176+dagmawibabi@users.noreply.github.com>
Co-authored-by: Braden Wong <13159333+braden-w@users.noreply.github.com>
2025-08-10 16:46:58 -07:00
Fraol LemechaGitHubKinfe123Bereket Engidacubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>Alex YangBereket Engida
2915e4c92d feat: add telemetry (#3822)
* feat: telemetry

Co-authored-by: Kinfe123 <kinfishtech@gmail.com>

* chore: remove changeset

* fix: do not generate project id unless telemetry is enabled

* fix: return `isInsiderContainerCached`

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

* chore: remove unused utils file

* fix: properly cache generated project id

* feat: interpret empty env vars as false

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

* fix: use nullish coalescing to set fallback

* fix: should be `isInsideContainerCached`

* fix: unique icons + tooltip for telemetry component

* fix: import child process from node

* fix: remove quotes in description

Co-authored-by: Alex Yang <himself65@outlook.com>

* fix: address reviews

Co-authored-by: Alex Yang <himself65@outlook.com>

* chore: refactor

* refactor

* add tests

* cache pkg json

* add cli tracking

* add migrate

* chore fix xi

* skip tet

* update snapshot

* chore: fix typecheck

* Expand telemetry docs: list collected fields, clarify anonymous redaction via getTelemetryAuthConfig, and document CLI events and audit/opt‑out paths.

* docs

* doc cleanup

* fixes

* remove git first commit message

* update docs

---------

Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Alex Yang <himself65@outlook.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-08-10 01:11:56 -07:00
MaxwellandGitHub 15e0e59f6d docs: remove invalid customPaths option (#3709)
Previously a merged PR had this, but that PR was revered however didn't reverse the docs for it.
2025-07-31 00:19:18 -07:00
Bereket EngidaandGitHub 5b1b242a88 Merge branch 'main' into v1.3 2025-07-18 20:09:14 -07:00
MaxwellandGitHub 7cc68b82f6 docs(faq): remove name, image, or email fields (#2688) 2025-07-18 18:54:26 -07:00
Bereket EngidaandGitHub 7d03460470 feat: add an option to encrypt oauth tokens by default (#2552)
* feat: add an option to encrypt tokens by default

* feat(auth): add OAuth token encryption support

* refactor(auth): streamline token handling in OAuth callback by utilizing setTokenUtil

* refactor(auth): replace direct token handling with setTokenUtil for improved clarity and maintainability

* refactor(auth): unify token handling by utilizing setTokenUtil for access and refresh tokens

* docs(auth): enhance documentation for OAuth token encryption, clarifying security risks and benefits

* chore: cleanup

* update test
2025-07-18 14:00:48 -07:00
KinfeMichael TarikuandGitHub 8bcc352856 docs: fix request lifecycle hooks example (#3434) 2025-07-17 15:48:06 -07:00
KinfeMichael TarikuandGitHub d9a925b315 docs: add logger option (#3171)
* docs/logging-docs

* update
2025-07-17 09:39:52 -07:00
991e200ff0 feat: add sendOnSignIn option to make sending verification link in sign in route explicit (#2422)
* feat(signin): make verification sending in sign in route explicit

* lint

* add option in docs

---------

Co-authored-by: Kinfe123 <kinfishtech@gmail.com>
2025-07-08 20:57:36 -07:00
Bereket Engida db2c0d0c8a docs: fix api typo on security guide 2025-06-07 15:04:41 -07:00
KinfeMichael TarikuandGitHub 0d33d9d8ed docs: basePath options in auth config (#2851) 2025-05-31 01:33:54 -07:00
KinfeMichael TarikuandGitHub 872a65adc1 docs: baseURL option in auth config (#2844) 2025-05-30 16:50:57 -07:00
TaesuandGitHub efc655de80 docs: add missing trustedOrigins option (#2822) 2025-05-28 21:31:38 -07:00
crutchtheclutchandGitHub fdee04fdc7 feat(customPaths): provide an option to modify and map api paths (#2193) 2025-05-28 10:32:03 -07:00
KinfeMichael TarikuandGitHub 8d82cf5959 docs: remove incorrect reference to nullable fieldAttribute 2025-05-27 17:33:03 -07:00
KinfeMichael TarikuandGitHub 25b7f4f2d6 chore: add clerk migration video guide 2025-05-27 01:33:23 -07:00
Björn RaveandGitHub ed44847a8d docs: improve wildcard domains usage (#2735) 2025-05-22 11:51:48 -07:00
Rahul MishraandGitHub 659f8391df docs: fix discord invite links 2025-05-17 05:09:10 -07:00
AnthonyandGitHub 5c9c5f5ef7 docs: fix grammar and spelling mistakes (#2300)
* Next.js

* ID

* Punctuation, code

* SQLite

* Capitalization

* Various corrections in "JWT"
2025-05-13 13:26:51 -07:00
Bereket Engida 926e580161 docs(fix): correct secondary storage api example in options reference 2025-04-29 12:34:47 -07:00
KinfeMichael TarikuandGitHub eccfcc3b31 chore: add better auth tanstack video guide 2025-04-21 22:22:43 +03:00
Bereket EngidaandGitHub 89cee73335 feat: make update account on signin optional (#2350) 2025-04-20 07:45:06 +03:00
KinfeMichael TarikuandGitHub c140af64f9 docs: resource reference page (#2357) 2025-04-20 00:53:50 +03:00
Anthony DePasquale 863129ca70 "up to date" (no hyphens needed when not modifying a noun) 2025-04-13 14:11:08 +02:00
Anthony DePasquale 25d517e99e TypeScript 2025-04-13 14:11:08 +02:00
Bereket Engida de0aadb37f docs(security): add IP address header configuration for Better Auth 2025-04-12 21:27:02 +03:00
Bereket EngidaandGitHub 9e951aa0b3 feat: add option to disable session refresh on use (#2126)
* feat: add option to disbale session refresh on use

* docs(session-management): add documentation for disabling session refresh option
2025-04-11 17:12:35 +03:00
986614b241 feat: createAdapter and useNumberId (#1926)
* refactor(adapter): `createAdapter` helper

* update: Kysely adapter support

* update: memory adapter

* chore: cleanup

* update: MongoDB adapter supported

* update: mongodb adapter file names

* update: support for prisma adapter

- also fixed memory adapter with `getField`
- disabled all debug logs by default

* chore: lint

* fix: generate an `id` if it isn't already provided

* update(test): init config snapshot

* update: existing adapters tests to include an `id` existence check

* fix: renamed prisma adapter file names

* ^

* update(mongo): Removed `disableIdGeneration` for mongo adapter

* fix: dont add `id` from fields if `disableIdGeneration` is false

* fix: adapter converting dates to string using the wrong value data

* add: create-adapter tests

* update: moved `adapter` to `create-adapter` under the existing `adapters` folder

* WIP: docs

* fix: create-adapter test importing from wrong path

* WIP: docs

* update: key transformation map options are now objs not fns

* chore: lint

* update: cleanup & added debugLogs/usePlural option to some adapters

* update: tests

* chore: cleanup

* update: fields name & made customTransforminput/output to run after supportsDates/supportsBoolean/SupportsJSON to run

* chore: lint

* Update: docs

* update: update-many to not use transformOutput

* chore: lint

* fix: adapter options breaking

* update: set the default limit on findMany

* update: docs

* update: docs & cleaned up code

* update: create schema comes with `tables` now

* This is useless

* fix: api-key shouldn't handle id gen in row creation

* chore: lint

* WIP: useNumberId

* chore: cleanup

* removed all cases of `id` during adapter.create call

* update: useNumberId

* update: drizzle adapter schema generation

- update: pg now sets `id` field to use `uuid`.
- fix: sets the correct reference `onDelete` action.
- refactor: cleaned up the code a lot more

* update: added `supportNumericIds` in create adapter options

* chore: cleanup

* update(tests): added option to disable any adapter tests & created a `useNumberId` test

* fix: skip tests options were using old method

* chore: lint

* WIP: Drizzle tests with number id

* chore: lint

* fix: memory adapter failing on number id adapter tests

* chore: cleanup

* fix: adapter tests fail due to emails needing to be unique

* update: support drizzle adapter use-number-id

* fix: cleanup Drizzle Adapter tests

* fix: drizzle schema generation for reference id fields

* fix: type errs in memory adapter tests

* fix: memory adapter tests

* Update init.test.ts.snap

* fix: prisma tests correctly uses the right primsa client per schema

* Delete run-vitest.ts

* update: create-adapter to support `getDefaultFieldName`

* update: create-adapter adapter options updated

* fix: adapters using older function names

* fix: create-adapter now converts where clauses & added tests

* update: new `getFieldAttributes` option in create-adapter, and fixed convert where clause fn

* chore: cleanup

* update: convertWhereClause in create-adapter improved

* update: BAOptions to start using `database` & updated adapter tests

* fix: type errors

* chore: lint

* update: default config values for the create-adapter config

* fix: getModelName doesnt take into account of plural

* chore: cleanup

* update: improved getDefaultModelname

* fix: create-adapter transform input doesn't take into account reference IDs

* fix: transformInput on reference IDs doesn't take into account of array IDs

* chore: lint

* fix: prisma tests

* fix: Prisma adapter tests running one after another

* fix: init snapshot should state supportJSON as `false`

* fix: drizzle adapter tests

* update: adapter test options to allow passing a test prefix

* chore: add state.txt to gitignore

* remove: state.txt from gitignore, it's useless

* chore: lint

* Update adapter.prisma.numberid.test.ts

* fix: get-migration for mysql & mssql `id` fields to use varchar

* chore: cleanup

* update: adapter comes with adapter-test-debug-log functions

* update: made adapterTestDebugLog functions only be in adapter if config enabled it

* fix: transactionId for debug logs not working correctly

This was due to the adapter being reinitialized each test case

* update: Added colors to debug logs

* update: adapter tests a little more refined

* add: deepmerge dev deps to deep merge better auth options config for adapters

* fix: create-adapter types

* update: revert back to old types

* fix: prisma adapter tests now run one after another

* fix: kysely adapter to work when no `id` is provided

* update: mongoDB to set `supportNumericids` to false

* update(docs): discuss new `database` object in BetterAuthOptions

* add: support for custom ID generation

* fix: docs had incorrect default value for `supportsJSON`

* update(docs): added number id adapter test documentation

* fix: drizzle-adapter mysql tests

* update: drizzle-adapter tests to use deepmerge

* add: drizzle-adapter mysql tests to test useNumberId

* add: Prisma generate to support number id

* update: support the old `generateId` option, but warn the user for deprecation

* update: init test snapshot

* update: adapter tests not included in normal tests

* Update pnpm-lock.yaml

* fix: typo in file names for kysley test files

* update: separated adapter tests

* Update pnpm-lock.yaml

* fix: please tell me I actually fixed this

* fix: pnpm-lock merge conflict

* chore: lint

* fix: sveltekit pkg.json merge conflicts (hopefully)

* Delete pnpm-lock.yaml

* update: createSchema takes into account of rate-limit and secondaryStorage

* improve docs

* add drizzle returning id retriver

* chore: fix test script

---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
2025-04-11 09:04:49 +03:00