Commit Graph
4400 Commits
Author SHA1 Message Date
KinfeMichael TarikuandGitHub 5242d82aa8 fix(open-api): include additional fields (#3439)
* open api additional field

* lint

* lint

* falsy value

* deprecated zodschema with zodtype
2025-07-18 10:10:17 -07:00
41fb4d15a8 feat(username): add custom username normalization option (#3412)
* feat(username): add custom username normalization option

* add transformer

* handle nullish values

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-18 10:03:28 -07:00
KinfeMichael TarikuandGitHub f521d7bf11 docs: organization option for cancelPendingInvitationsOnReInvite (#3440)
* docs: organization option for canceling on reinvite

* default val

* lint
2025-07-18 10:02:46 -07:00
Fraol LemechaandGitHub 577ad2a97f fix(organization): allow org owner to update their own roles (#3426)
* fix: allow org owner to update their own roles

* fix(org): move the `is creator` check to the `hasPermissions` function to make it more reusable
2025-07-18 10:02:24 -07:00
d66c6c935d fix(sso): saml redirection (#3343)
* saml redirection

* loh

* lint

* dashboard

* lint

* test

* test

* function based mock idp

* redirection and callbacks

* console

---------

Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-07-17 21:58:12 -07:00
KinfeMichael TarikuandGitHub ce75d25c4f fix(stripe): allow upgrading incomplete subscriptions (#2930)
* fix: subscription upgrade

* lint
2025-07-17 21:08:50 -07:00
MaxwellandGitHub 322906802f chore: lint (#3437) 2025-07-17 16:40:34 -07:00
MaxwellandGitHub d73e7b8527 chore: fix type issue (#3436) 2025-07-17 16:33:50 -07:00
MaxwellandGitHub 1ed38cd28b feat(docs): APIMethod, documents all server & client auth examples (#2577) 2025-07-17 16:20:10 -07:00
8fa4c9ce7e feat(stripe): pass context obejct to stripe plugin callbacks (#2990)
* feat(stripe): pass context obejct to stripe plugin callbacks

* cleanup

* cleanup

* cleanup

* chore: lint

* fix: tests

---------

Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-17 14:48:11 -07:00
Kinfe123 78e384e3f5 fix: sso typecheck 2025-07-17 23:32:47 +03:00
Kinfe123 5508b02d77 fix: zodv4 migration leftover due to conflict 2025-07-17 23:23:58 +03:00
Bereket EngidaandGitHub ea0fcdab70 Revert "feat(social-providers): add Faceit Social Provider (#3140)" (#3432)
This reverts commit 8792717b4b.
2025-07-17 10:11:45 -07:00
Matt RussellGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>ping-maxwell
8792717b4b feat(social-providers): add Faceit Social Provider (#3140)
* create faceit provider

* include new faceit provider

* updating docs to include faceit

* Update docs/content/docs/authentication/faceit.mdx

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

* Update docs/components/builder/social-provider.tsx

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

* formatting

* formatting

* formatting

* Update documentation

Updated to include callout about Faceit's Redirect URL requirements

* fix: docs

* chore: cleanup

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-17 10:10:07 -07:00
Bereket Engida 85d5c6c720 chore: release v1.3.0-beta.9 2025-07-17 10:08:50 -07:00
Bereket Engida 56bd676534 Merge branch 'main' into v1.3 2025-07-17 10:08:46 -07:00
KinfeMichael TarikuandGitHub 15452a5402 fix: mysql foreign key constraints on generate (#2828)
* fix: mysql foreign key constraints

* lint

* clean up

* clean up

* lint
2025-07-17 09:58:52 -07:00
LamiandGitHub 9c1293de50 fix(generic-oauth): error callback should avoid malformed URLs when the original URL already has query parameters (#3430) 2025-07-17 09:56:16 -07:00
6119db7a3d fix(mcp): issue with hardcoded baseURL in withMcpAuth (#2971)
* fix issue with hardcoded baseURL in withMcpAuth

* chore: lint

---------

Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-17 09:54:32 -07:00
Bereket Engida b8cee4f188 chore: remove unused file 2025-07-17 09:34:59 -07:00
AbdallahandGitHub e02c28115d fix: schema generation when using advanced.databse.useNumberId (#3311)
* fix: schema generation when using advanced.databse.useNumberId

* fix: ci test
2025-07-17 09:06:21 -07:00
KinfeMichael TarikuandGitHub 4cff983e5c refactor: migrated all packages from Zod v3 to Zod v4 (#3399)
Refactors
- Updated all imports and type references to use zod/v4.
- Replaced deprecated or changed Zod APIs and options across the codebase.
- Adjusted validation schemas and error messages to match Zod v4 requirements.
- Updated dependencies and lockfiles to use Zod v4.
2025-07-17 08:30:02 -07:00
ff54a99c55 feat(oidc): add support for public clients with PKCE authentication (#3091)
* feat(mcp): add support for public clients with PKCE authentication

  - Add conditional client authentication based on client type
  - Support public clients using PKCE without client_secret requirement
  - Add "none" to supported token endpoint authentication methods
  - Make clientSecret optional in database schema for public clients
  - Update client registration to handle public clients automatically
  - Maintain backward compatibility with confidential clients

  Fixes authentication issues with Claude.ai and other public OAuth clients
  that use PKCE (Proof Key for Code Exchange) without client secrets.

  Resolves #2813

* style: format code with prettier and fix trailing commas

* fix: resolve TypeScript errors in MCP plugin and tests

  - Fix missing loginPage in oidcConfig for MCP tests
  - Add type assertions for unknown response data types
  - Handle optional clientSecret with null coalescing operators
  - Update OIDC provider to support "none" auth method in metadata
  - Fix type compatibility issues between public and confidential clients

* fix: resolve TypeScript, Vitest, and CI compatibility issues

  - Fix missing loginPage in oidcConfig for MCP tests
  - Add type assertions for unknown response data types
  - Handle optional clientSecret with null coalescing operators
  - Update OIDC provider to support "none" auth method in metadata
  - Fix async describe callback to use synchronous setup with beforeAll
  - Use ephemeral port allocation to prevent CI port conflicts
  - Add explicit type annotations to avoid implicit any errors

* OpenAPI Schema Contract Fixed

* fix: resolve lint

* fix: ensure OAuth 2.0 spec compliance for public client registration

  - Fix public client registration to omit client_secret field entirely
  - Public clients now receive no client_secret property (was empty string)
  - Maintains backward compatibility with confidential clients
  - Addresses OAuth 2.0 Dynamic Client Registration (RFC 7591) requirements

* update docs

* remove any

* dont return secret on public client oidc

* remove any

* conditionally verify client secret

* update test

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-17 00:38:19 -07:00
57c7691a7b fix(api-key): non-expiring API keys (with expiresAt set to null) were being deleted by mistake (#3413)
* fix(api-key): API Keys with expiresAt not null 

The `deleteAllExpiredApiKeys` function in the apiKey plugin deletes API keys where `expiresAt` is `null`, despite these keys being intended as non-expiring. 

This occurs because the deleteMany query does not explicitly exclude null values in the expiresAt condition. 

This leads to unexpected key deletions, affecting keys like 
`{ "_id": "6876ba254c23e91c05c9e95b", "expiresAt": null }`.

* Update index.ts

* chore: lint

---------

Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-17 00:36:32 -07:00
ShubhamandGitHub d130805777 fix(oidc-provider): relax offline_access scope validation by removing prompt=consent requirement (#3420) 2025-07-16 22:14:33 -07:00
CaoMeiYouRenGitHubMaxwellcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>ping-maxwell
2ac4f9db35 feat(generic-oauth): add support for additional token URL params in generic OAuth (#3410)
* feat(generic-oauth): add support for additional token URL params in generic OAuth

fix #3402

* Update packages/better-auth/src/oauth2/validate-authorization-code.ts

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

* fix: syntax error

---------

Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: ping-maxwell <maxwell.multinite@gmail.com>
2025-07-16 21:13:31 -07:00
KinfeMichael TarikuandGitHub adf8be7acb fix(admin): before create hook was not triggered when creating a user through the admin plugin (#3418)
* ctx pass on the create with hook

* ctx
2025-07-16 21:12:57 -07:00
KinfeMichael TarikuandGitHub 29c76c7667 fix(dropbox): added support for the token access type option (#3419) 2025-07-16 21:11:04 -07:00
Bereket EngidaGitHubBadPiratecubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
d4fc7b4a7f feat(oidc-provider): support encrypting and hashing secrets (#3416)
* (feat:oidcProvider): Trusted Client implementation

- Add trustedClients configuration to OIDCOptions
- Add skipConsent property to Client interface
- Implement unified getClient() function for layered lookup
- Update authorize and token flows to support trusted clients
- Add comprehensive documentation and examples

* Apply suggestions from code review

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

* lint

* fix: model name

* feat(oidc): implement secure client secret storage options

* chore: cleanup

---------

Co-authored-by: BadPirate <badpirate@gmail.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-16 19:54:11 -07:00
82b6974ffa feat(oidc): support JWKs with JWT plugin (#2755)
* fix(oidc): use JWT plugin if enabled to sign keys

* test(oidc-jwt): add comprehensive tests for OIDC JWT plugin functionality

* update docs

* refactor and cleanup

---------

Co-authored-by: Kryspin <321453+kziemski@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-16 18:29:42 -07:00
BadPirateGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>Bereket Engida
8223ddd30d feat(oidc-provider): trusted clients (#2878)
* (feat:oidcProvider): Trusted Client implementation

- Add trustedClients configuration to OIDCOptions
- Add skipConsent property to Client interface
- Implement unified getClient() function for layered lookup
- Update authorize and token flows to support trusted clients
- Add comprehensive documentation and examples

* Apply suggestions from code review

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

* lint

* fix: model name

* chore: cleanup

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-16 16:29:23 -07:00
Bereket Engida 5a55d7f1ee Merge branch 'main' into v1.3 2025-07-16 15:02:19 -07:00
ShubhamandGitHub 6f0f61a262 feat(oidc): add refresh token support to discovery document and token endpoint (#3373)
* feat(oidc): add refresh token support to discovery document and token endpoint

* types(oidc): ensure grant_types_supported is non-empty tuple

* fix(oidc): format grant_types_supported array for better readability
2025-07-16 15:00:36 -07:00
7364c169f6 fix: implement standard Base64 encoding for HTTP Basic Auth in token refresh and validation (#3388)
* fix(auth): implement standard Base64 encoding for HTTP Basic Auth in token refresh and validation

- Updated `refreshAccessToken` and `validateAuthorizationCode` functions to use standard Base64 encoding instead of URL-safe encoding for HTTP Basic Authentication.
- Ensured compatibility with providers like Notion and Twitter by adhering to OAuth2 specifications (RFC 7617).
- Set default authentication method to "basic" in the generic OAuth plugin for better consistency.

* fix(auth): utilize utility function for standard Base64 encoding in token refresh and validation

- Refactored `refreshAccessToken` and `validateAuthorizationCode` functions to use `encodeBasicAuthHeader` utility for standard Base64 encoding of HTTP Basic Authentication.
- This change enhances compatibility with providers like Notion and Twitter, adhering to OAuth2 specifications (RFC 7617).
- Simplifies the code by removing direct Buffer usage for encoding.

* use better auth utils

* fix base 64 code api

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
2025-07-15 13:59:40 -07:00
KinfeMichael TarikuandGitHub be511008f1 chore: refactor admin plugin schema (#3371)
* admin plugin type isolation

* lint

* import

* import
2025-07-14 22:18:07 -07:00
MaxwellandGitHub 8bd66308e2 fix(next-cookies): Don't throw in monorepo workspaces (#3381) 2025-07-14 14:54:06 -07:00
DannyandGitHub f569ff1402 docs: extend rate limiting docs and add small warning (#3365)
* refactor: remove useless variable assignment

* refactor: remove unused param

* docs: extend rate limit docs to include info about connecting ip address and how it's used

* fix: linting
2025-07-14 09:38:06 -07:00
Andrew PattonandGitHub 7835167b82 fix: add image option to signUpEmail types and schema (#3357)
`signUpEmail` destructures the optional `image` field from the request body and uses it when creating the user, but the field isn’t in the `requestBody` schema or the `$Infer` `body` type
2025-07-12 13:13:21 -07:00
KinfeMichael TarikuandGitHub de20ad60aa refactor: organization types (#3342)
* org options type export

* lint

* typecheck
2025-07-11 10:01:40 -07:00
KinfeMichael TarikuandGitHub c3b1ddf5ea chore: org check slug test suite (#3345)
* check slug test

* lint
2025-07-11 09:39:49 -07:00
MaxwellandGitHub 3547c9d09a feat(organization): listUserInvitations adds the ability to list all invitations for a given user (#3121)
* feat(org): listUserInvitations

This PR introduces  in the org plugin.

* chore: lint
2025-07-10 23:58:12 -07:00
Alec LarsonandGitHub 6e4c2fe563 chore(docs): fix callbackURL description of signInUsername endpoint (#3339) 2025-07-10 17:54:58 -07:00
Alexander LyonandGitHub 9c3a1388b2 fix: don't require email for account linking (#3335)
We throw errors on both code paths despite it not being used when linking. Move the error to after the link case so that we only bail on missing info if that missing info is actually needed.
2025-07-10 14:03:54 -07:00
MaxwellandGitHub 79f5f73291 feat(api-key): requireName to enforce name on keys (#3129)
* feat(api-key): `requireName` to force require name on keys

* chore: lint
2025-07-10 11:17:00 -07:00
KinfeMichael TarikuandGitHub a2029ef7fd fix: linking accounts for anon users with one tap and passkey (#3124)
* typo

* typo

* linking accounts

* clean up

* clean up

* clean up

* clean up
2025-07-10 11:15:37 -07:00
Bereket Engida c4c9530602 chore: release v1.3.0-beta.8 2025-07-10 11:12:07 -07:00
843482fe4a feat: add slack social provider (#3315)
* feat: add slack provider

* feat: add slack provider docs

* chore:lint

* chore:lint

* docs: add is new flag

---------

Co-authored-by: Bereket Engida <Bekacru@gmail.com>
Co-authored-by: Bereket Engida <86073083+Bekacru@users.noreply.github.com>
2025-07-10 11:11:34 -07:00
Bereket Engida ed8fbb890f Merge remote-tracking branch 'origin/main' into v1.3 2025-07-10 10:12:11 -07:00
Alec LarsonandGitHub 1c6a1dcf9f feat: add rememberMe option to signUpEmail (#3325) 2025-07-09 22:07:15 -07:00
Alec LarsonandGitHub 63921f6eec fix(username): add callbackURL option to signInUsername (#3324) 2025-07-09 22:04:39 -07:00