Repository navigation
chore(deps): upgrade better-auth to 1.7.12 - #9465
waleedlatif1 wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Critical impact] No new blocking issue was established; the PR appears safe to merge with the acknowledged SAML rollout risk. SummaryUpgrades Better Auth and its plugins to
|
There was a problem hiding this comment.
Review completed against the latest diff
This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Moves better-auth, @better-auth/oauth-provider, @better-auth/sso and @better-auth/stripe (and packages/auth) from 1.6.27 to 1.7.12, which carries the 1.7.7 fixes for the magic-link, OAuth proxy, device-authorization and rate-limit advisories. Each place 1.7 changes behavior Sim relies on is adapted so connects, sign-ins, the MCP OAuth provider and enterprise SSO keep working. Dependencies - @better-auth/core calls z.validate, added in zod 4.5; the root override keeps zod on 4.3.6, so a version-pinned patch restores 1.6's safeParse form. - The global @xmldom/xmldom 0.8.15 override is dropped: @better-auth/sso needs 0.9.12, and samlify, xml-crypto, mammoth, officeparser and plist keep 0.8.15. - The oauth-provider 1.6.27 resource patch is obsolete and removed. Integration connectors - Generic OAuth no longer serves /oauth2/*; the registered /api/auth/oauth2/callback/:id URIs are forwarded to core's /callback/:id, so no provider registration changes. Clients link through linkSocial. - Custom getToken uses the registered redirect URI; Google connectors use explicit endpoints instead of discovery; scope rewrites move into the token exchange; reserved authorization params (scope, nonce) are passed as options; pkce stays off where it was off. - Connector callbacks only complete an authenticated link and never sign up or sign in a user; linking counts the profile email as verified. - Account hooks identify connector callbacks by the account's provider, since hook contexts carry the route pattern. MCP OAuth provider - Resources stay out of 1.7's static resource model via a signed sim_resource parameter; public clients are recognized by token_endpoint_auth_method none; dynamic registration infers the application type; registrations keep their requested scopes; DPoP is refused and metadata advertises only what Sim honors; access tokens revoked at sign-out are rejected. - Migration 0447 adds 1.7's columns and tables expand-only, so 1.6 and 1.7 pods share the schema during rollout. Runtime schema validation is off because migrations own Sim's schema. Enterprise SSO - The legacy SAML ACS URL is forwarded to /sso/saml2/sp/acs/:id, so IdPs need no change; new providers advertise the new URL. - Registration matches 1.7's strict schemas (no mapping.id; idpMetadata as metadata or entityID) and checks 1.7's sign-in policy on save. - Migration 0448 spells out entityID for certificate-only providers and clears wantAssertionsSigned where the SP metadata never asked for signed assertions, keeping 1.6's accept-any-IdP-signature policy. - POST sign-in/email-otp is refused: 1.7 deletes every linked account of an unverified user there.
…the new test calls
… migration 0448 - Keep the SSO plugin's parsed registration body, as before 1.7. - Compare issuers exactly when carrying over a token auth method. - Surface linkSocial start errors in the connect hook and desktop launcher. - Accept whitespace around WantAssertionsSigned in migration 0448 and the script. - The register script refuses custom SP metadata that contradicts its signing flag and prints the stored SAML ACS URL.
…ing token families Better Auth 1.7 revokes a replayed code's tokens by authorizationCodeId outside any transaction. The adapter guard now deletes the grant's token families (cascading to its tokens) and refuses an access-token insert whose refresh token a concurrent replay already removed as invalid_grant instead of a 500.
…ript SAML audiences working on Better Auth 1.7 - Forward a client's Basic credentials to Better Auth unchanged; 1.7 decodes them itself and refuses a client_secret_basic client that arrives through the body - Drop a client's dpop_jkt instead of refusing the authorization request, matching 1.6, since Sim issues bearer tokens only - Allow IdP-initiated SAML, which 1.7 turns off by default; correct the docs that said it was rejected - Migration 0448 drops a SAML audience equal to the IdP's own entity ID (the registration script's old default), which 1.7 now enforces exclusively; the script now leaves audience unset - Order migration 0447's ALTERs the way token issuance locks the tables - Turn off Better Auth's runtime schema check in the realtime one-time-token verifier - Share one issuer normalizer across SSO, accept either quote in WantAssertionsSigned, and tidy comments
5ba954d to
f403950
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Moves
better-auth,@better-auth/oauth-provider,@better-auth/sso,@better-auth/stripe(andpackages/auth) from 1.6.27 to 1.7.12. 1.7.7+ fixes the magic-link, OAuth-proxy, device-authorization and DB rate-limit advisories (not reachable today, but 1.6 gets no fixes). Each 1.7 behavior change Sim depends on is adapted, following the 1.7 upgrade guide.Dependencies
@better-auth/corecallsz.validate(zod 4.5+); the root override keeps zod at 4.3.6, so every sign-in would throw. Version-pinned patch restores 1.6'ssafeParseform (documented inpatches/README.md)@xmldom/xmldom0.8.15 override: sso 1.7 needs 0.9.12 (onError), while samlify/xml-crypto/mammoth/officeparser/plist keep 0.8.15 (0.9 throws without a MIME type)Integration connectors (generic OAuth lost its
/oauth2/*endpoints)/api/auth/oauth2/callback/:idURIs are forwarded to core/callback/:id— no provider re-registrationlinkSocial; customgetTokenkeeps the registered redirect URI; Google connectors use explicit endpoints instead of discovery; scope rewrites moved into the token exchange; reserved authorize params (scope,nonce) passed as options;pkce: falsekept explicit where 1.6 had it offMCP OAuth provider
sim_resourceparamtoken_endpoint_auth_method: none(1.7 droppedpublic); registration infers app type so loopback/cursor://callbacks still register; requested scopes are kept; adpop_jktis dropped (bearer tokens only, as in 1.6); metadata advertises only what Sim honors; tokens revoked at sign-out are rejectedclient_secret_basicclient whose credentials arrive in the bodyEnterprise SSO
/sso/saml2/sp/acs/:id(POST and GET), so IdPs need no change; new providers advertise the new URLmapping.id;idpMetadataas metadata orentityID) and checks 1.7's sign-in policy on saveentityIDfor cert-only providers, and clearswantAssertionsSignedwhere SP metadata never asked for signed assertions — keeping 1.6's accept-any-IdP-signature policy so IdPs that sign only the Response keep working; and drops anaudienceequal to the IdP's own entity ID (the registration script's old default), since 1.7 checksaudienceexclusively where 1.6 also accepted the SP entity IDPOST sign-in/email-otprefused: 1.7 deletes every linked account of an unverified user thereBehavior changes to expect
sub/ SAML NameID; providers that mapped another id claim re-link by email on their verified domain (new account row, same user)issexactlyoffline_access) surviveType of Change
Testing
client_secret_basicandclient_secret_postclients (the Basic case fails on the previous code)drizzle-kit generateclean,check:migrations, biome; full type-check and audits run in CIChecklist
test-auditauthoring gate)