Files
better-auth/packages
Gustavo Valverde 3fbc2f3405 test(generic-oauth): port regression suites onto the social-provider rewrite (#9799, #9792, #9702, #9578)
next's #9069 rewrote generic-oauth to flow through the core social provider
and callback. The #9799 accessTokenExpiresIn source fix merged in cleanly
(its config field and the applyDefaultAccessTokenExpiry wiring land on the
three token paths); main's regression tests still targeted the old
signIn.oauth2 plugin API. This ports them onto signIn.social so they keep
guarding the behavior:

- #9799: getAccessToken refreshes once the accessTokenExpiresIn window passes
  when the provider omits expires_in, does not refresh when it is unset, and
  applies it to a custom getToken result.
- #9792: the verify-email link preserves the encoded callbackURL.
- #9702: a session hook throwing an APIError redirects to the cross-origin
  errorCallbackURL with the hook's code (proves the rewritten callback's
  hook-error forwarding).
- #9578: implicit-link tests mark the local user verified so linking is
  allowed under the default-on requireLocalEmailVerified gate.

A stale IDP-bounce assertion is updated to next's state-error vocabulary.
All 71 tests pass.

(cherry picked from commit 52adab0db3f463295a0c4e3152d770f4ce40b2d2)
2026-05-31 00:10:36 +01:00
..
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00
2026-05-31 00:10:16 +01:00