Commit Graph

137 Commits

Author SHA1 Message Date
Bereket Engida
72ec62ff06 chore: integrate new dash and sentinel into authentication flow (#8053) 2026-02-18 13:02:21 -08:00
Joél Solano
1c9aab3bce feat: electron integration (#7647)
Co-authored-by: Alex Yang <himself65@outlook.com>
2026-02-04 20:37:05 +00:00
Alex Yang
c1f046f588 chore: bump version (#7646) 2026-01-27 23:12:31 +00:00
Taesu
ac0cb53ec0 chore(demo): correct trustedProviders option (#7449) 2026-01-18 21:54:03 +00:00
Bereket Engida
ab5c2e7d64 chore(demo): hide admin dashboard for non-admin users 2026-01-17 22:18:42 -08:00
Alex Yang
cccfe03283 chore: add @better-auth/dash (#7433) 2026-01-17 04:23:48 +00:00
Jonathan Samines
2a728dbd95 chore(scim): add SCIM demo (#6639)
Co-authored-by: Alex Yang <himself65@outlook.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 16:15:24 -08:00
Bereket Engida
3b7b96ee02 demo: improve demo project ui (#7269)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@users.noreply.github.com>
2026-01-11 14:50:10 -08:00
Dylan Vanmali
686fba4e11 feat(oauth-provider): an oauth 2.1 compliant plugin (#4163)
An upgrade to oidc-provider plugin that makes it oauth2.1 compliant and has a configuration that is secure by default.

Plans for the deprecation of oidc-provider plugin due to many inherent flaws in its design. Internally, plugin functions now share logic, providing for better future extensibility if new code_grants need to be written or user/client jwt or opaque tokens need to be written. Furthermore, as an oAuth 2.1 provider, it provides logic valid for an MCP server. When using the scope "openid" (optional, enabled by default), the server acts like an OpenId server able to issue id tokens and provides a /userinfo endpoint.

Features

OAuth 2.1 by default
Properly supports authorization_code, refresh_token, and client_credentials grants
PKCE by default (removes plain completely)
Public and confidential client registration
JWT plugin is required by default, but can be disabled using disableJWTPlugin flag
Access tokens can now be received in JWT verifiable format using the resource parameter (ie JWT aud field)
Id tokens are still verifiable by JWKS when using JWT Plugin, or clientSecret if disabled. Fixes issue to prevent public clients when disableJWTPlugin: true from obtaining id tokens directly even when they shouldn't be allowed an id token and should use /userinfo instead.
Protects /userinfo with scope check
Separates Refresh Token and Access token on database schema to allow multiple access tokens per refresh and multiple refresh tokens per login session.
oauthAccessToken strictly deals with opaque tokens
Opaque tokens are given only when resource parameter (aka audience) is not provided
Option to Encode and Decode refresh tokens
allowDynamicClientRegistration with allowUnauthenticatedClientRegistration flags
Separation of default expiration times
Proper creation of public and confidential clients
Prevents misconfiguration between .well-known/openid-configuration endpoint and plugin settings
scopeExpirations to assign scopes specific expiration
Custom claims through separated functions: customAccessTokenClaims, customIdTokenClaims, and customUserInfoClaims
Organizational support through activeOrganizationalId on a session such as through the organizational plugin. Attaches to oAuthClient via reference_id.
Rp-initiated logout
Account Selection via prompt=select_account.
Account Creation via prompt=create.
Prompt combinations prompt=select_account+consent and prompt=login+consent

Docs available at https://www.better-auth.com/docs/plugins/oauth-provider (pr: https://github.com/better-auth/better-auth/blob/main/docs/content/docs/plugins/oauth-provider.mdx)
2025-12-22 11:16:42 -08:00
Taesu
b1ca46f560 chore(demo): improve nextjs demo (#6727) 2025-12-19 23:02:12 -08:00
Jonathan Samines
fbe51c8f93 chore: add spell checker (#6319) 2025-12-01 10:33:38 -08:00
LovelessCodes
d35a312d5e refactor: Keep environment variable names consistent (#6349) 2025-11-27 19:52:55 -08:00
Ana Trajkovska
3ed454b257 feat: Add Vercel as OAuth provider (#6316) 2025-11-26 16:22:02 +00:00
Taesu
4328571288 chore(demo): update auth instance to work with oauth-proxy (#6151)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-21 05:34:33 +00:00
Jonathan Samines
57ee11a26f chore(lint): enforce consistent import type style (#6044) 2025-11-17 21:11:39 +00:00
Taesu
f327e336c8 refactor: split the passkey plugin into a separate package (#5769) 2025-11-05 17:05:39 +00:00
Alex Yang
2f02916bd2 fix(oauth): redirect to GET for POST method (#5759) 2025-11-05 00:33:26 +00:00
Bereket Engida
956eb5b015 Revert "fix(cookie): sameSite to "none" for oauth state (#5748)"
This reverts commit 324a2ed343.
2025-11-04 00:17:22 -08:00
Alex Yang
324a2ed343 fix(cookie): sameSite to "none" for oauth state (#5748) 2025-11-04 05:13:24 +00:00
Alex Yang
13dee5362c chore(demo): fix url for vercel preview 2025-11-03 18:01:59 -08:00
Alex Yang
6ccc2246ac chore(demo): enable apple login (#5746) 2025-11-04 01:47:25 +00:00
Alex Yang
938c2a7c31 chore: lint enable organize import (#5556) 2025-10-24 19:05:09 +00:00
Dylan Vanmali
9907798400 chore(demo): fix sso (#4934) 2025-09-29 19:34:08 -07:00
KinfeMichael Tariku
b3ead859e6 feat(sso): defaultSSO options and ACS endpoint (#3660)
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-09-19 17:26:53 +00:00
Fathi
f6f1902b59 feat: add getActiveRoleMember (#4484)
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
Co-authored-by: Alex Yang <himself65@outlook.com>
2025-09-09 14:48:55 -07:00
Alex Yang
d4c15829bc feat(demo): improve sign-up component (#3789) 2025-09-03 13:03:54 -07:00
Alex Yang
795516b3ee fix(demo): put get plans inside a sync function (#4372) 2025-09-03 00:25:25 -07:00
Bereket Engida
2db142465e feat: add last login method plugin (#4347) 2025-09-01 13:15:23 -07:00
Alex Yang
5c24e6152e demo: fix domain issue on preview env (#4140) 2025-08-21 16:33:49 -07:00
Alex Yang
5ded0904d4 feat: support device authorization (#3811) 2025-08-21 14:59:31 -07:00
Shobhit Patra
96b5fabdfa feat(paypal): add paypal OAuth2 provider (#4107) 2025-08-21 11:50:03 -07:00
Bereket Engida
d587f5b604 chore: enable subdomain cookies 2025-07-27 20:29:38 -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
Bereket Engida
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
Bereket Engida
fd727e515d chore: update kysley to 0.28.2 2025-05-31 09:14:05 -07:00
Bereket Engida
9cc2e3d8ab feat: MCP plugin (#2666)
* chore: wip

* wip

* feat: mcp plugin

* wip

* chore: fix lock file

* clean up

* schema

* docs

* chore: lint

* chore: release v1.2.9-beta.1

* blog

* chore: lint
2025-05-23 12:44:51 -07:00
Anthony DePasquale
fc4c0eb280 Better Auth 2025-04-13 14:11:08 +02:00
ririxi
cb900f9594 feat(organization): support multiple permissions check (#2227)
* feat: remove the artificial resource limit so that code can check

Also change `permission` to `permissions` (clearer for end user). `permission` is left for backwards compatibility.

* docs: add examples for multiple perms checking

* refactor: check `permissions` first, then legacy one

* feat: use union types for `permission` & `permissions`

* fix: properly use union types

* fix: remove accidental `@deprecated` comment

* chore: lint

* fix test

* chore: add oneTimeToken plugin to client barrel exports (#2224)

* docs(expo): add id token usage

* feat(oauth2): override user info on provider sign-in (#2148)

* feat(oauth2): override user info on provider sign-in

* improve email verification handling

* resolve mrge

* fix(sso): update overrideUserInfo handling to use provider configuration

* fix param

* chore: change plugin interface middleware type (#2195)

* fix: delete from session table when stopImpersonate called (#2230)

* chore: fix active organization inferred type

* chore: fix admin test

---------

Co-authored-by: Bereket Engida <bekacru@gmail.com>
Co-authored-by: Wade Fletcher <3798059+wadefletch@users.noreply.github.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
Co-authored-by: KinfeMichael Tariku <65047246+Kinfe123@users.noreply.github.com>
2025-04-12 22:00:58 +03:00
Bereket Engida
c1216a988d demo: add impersonation stop button and admin user configuration 2025-03-04 14:33:04 +03:00
Bereket Engida
0194b50e23 refactor(demo): change database configuration 2025-03-04 10:12:56 +03:00
Bereket Engida
2704f22dee fix(stripe): cancel should properly apply for immediate trail cancels 2025-03-03 19:44:53 +03:00
Bereket Engida
07d32ac479 chore: update demo .env.example 2025-03-03 11:31:35 +03:00
Bereket Engida
4ec68150d7 chore: lint 2025-03-03 11:18:10 +03:00
Bereket Engida
ed2c7ab84b chore: fix docs highlighting 2025-03-02 21:00:35 +03:00
Bereket Engida
dab0c80384 docs: remove unused schema from stripe docs 2025-03-02 15:16:28 +03:00
Bereket Engida
a3c5ac8233 demo: use turso by default 2025-03-02 13:37:32 +03:00
Bereket Engida
1c16655aba fix(stripe): update subscription webhook handling should use customer id as a fallback 2025-03-02 13:36:51 +03:00
Bereket Engida
1c91294e23 fix(stripe): improve subscription cancellation handling and add callback endpoint 2025-03-02 11:40:01 +03:00
Bereket Engida
4f56078e4b feat: stripe plugin to handle subscriptions and customers (#1588)
* init

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* feat(stripe): enable subscription support and update pricing plans

* feat(stripe): add Vitest configuration and initial tests for Stripe integration

* feat(stripe): implement setCookieToHeader function and update tests for customer creation and subscription handling

* feat(stripe): add seats support for subscriptions and update related endpoints

* feat(stripe): update schema to include unique referenceId, stripeSubscriptionId, and periodEnd fields

* wip docs

* docs

* docs: imporves

* fix(stripe): update webhook handlers to use correct subscription identification

* refactor(stripe): simplify customer management by storing Stripe customer ID directly on user

* chore(stripe): update package configuration and build setup

- Migrated from tsup to unbuild for build configuration
- Updated package.json with improved export and dependency management
- Added build configuration for better module support
- Removed tsup configuration file

* chore(stripe): update pnpm lockfile dependencies

- Moved `better-auth` from devDependencies to dependencies
- Added `zod` as a direct dependency
- Reorganized package dependencies in the lockfile

* feat(stripe): enhance subscription management and error handling

- Added toast error handling for subscription upgrades in the dashboard
- Updated Stripe price IDs for different plans
- Improved Stripe plugin documentation with beta warning and team subscription details
- Implemented intermediate redirect for checkout success to handle race conditions
- Added support for fetching and updating subscription status after checkout
- Fixed Next.js cookie handling and build configuration

* chore: update snapshot
2025-03-01 01:20:17 +03:00
Mohamad Malek Alkhodary
20965ff851 docs: fix file import typo (#1592) 2025-02-28 07:27:18 +03:00