better-auth 1.7.0-beta.2 → 1.7.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -15
- package/dist/_virtual/_rolldown/runtime.mjs +10 -1
- package/dist/api/index.d.mts +18 -48
- package/dist/api/routes/account.d.mts +4 -23
- package/dist/api/routes/account.mjs +102 -75
- package/dist/api/routes/callback.mjs +42 -20
- package/dist/api/routes/email-verification.d.mts +1 -0
- package/dist/api/routes/email-verification.mjs +6 -5
- package/dist/api/routes/error.mjs +1 -1
- package/dist/api/routes/password.mjs +1 -1
- package/dist/api/routes/session.mjs +15 -10
- package/dist/api/routes/sign-in.d.mts +3 -1
- package/dist/api/routes/sign-in.mjs +13 -15
- package/dist/api/routes/sign-up.d.mts +1 -0
- package/dist/api/routes/sign-up.mjs +10 -8
- package/dist/api/routes/update-user.mjs +8 -8
- package/dist/api/to-auth-endpoints.mjs +7 -1
- package/dist/auth/base.mjs +30 -27
- package/dist/client/config.mjs +8 -1
- package/dist/client/fetch-plugins.mjs +2 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/lynx/index.d.mts +13 -0
- package/dist/client/lynx/index.mjs +2 -1
- package/dist/client/parser.mjs +0 -1
- package/dist/client/plugins/index.d.mts +4 -17
- package/dist/client/plugins/index.mjs +1 -4
- package/dist/client/proxy.mjs +2 -1
- package/dist/client/react/index.d.mts +13 -0
- package/dist/client/react/index.mjs +2 -1
- package/dist/client/session-atom.mjs +12 -1
- package/dist/client/solid/index.d.mts +13 -0
- package/dist/client/solid/index.mjs +3 -2
- package/dist/client/svelte/index.d.mts +13 -0
- package/dist/client/svelte/index.mjs +2 -1
- package/dist/client/vanilla.d.mts +13 -0
- package/dist/client/vanilla.mjs +2 -1
- package/dist/client/vue/index.d.mts +13 -0
- package/dist/client/vue/index.mjs +2 -1
- package/dist/context/create-context.mjs +10 -14
- package/dist/context/helpers.mjs +3 -2
- package/dist/cookies/cookie-utils.d.mts +33 -1
- package/dist/cookies/cookie-utils.mjs +95 -14
- package/dist/cookies/index.d.mts +2 -3
- package/dist/cookies/index.mjs +39 -11
- package/dist/cookies/session-store.mjs +4 -23
- package/dist/db/get-migration.mjs +4 -4
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +3 -2
- package/dist/db/internal-adapter.mjs +129 -27
- package/dist/db/schema.d.mts +14 -1
- package/dist/db/schema.mjs +26 -1
- package/dist/db/with-hooks.d.mts +1 -0
- package/dist/db/with-hooks.mjs +58 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/integrations/cookie-plugin-guard.mjs +18 -0
- package/dist/integrations/next-js.mjs +6 -0
- package/dist/integrations/svelte-kit.mjs +6 -0
- package/dist/integrations/tanstack-start-solid.mjs +6 -0
- package/dist/integrations/tanstack-start.mjs +6 -0
- package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/index.mjs +32 -0
- package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/linux.mjs +55 -0
- package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/macos.mjs +26 -0
- package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/termux.mjs +39 -0
- package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/windows.mjs +19 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs +845 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs +386 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs +320 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +62 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +190 -0
- package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/utils.mjs +2 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.mjs +29 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.mjs +42 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.mjs +67 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.mjs +23 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.mjs +22 -0
- package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.mjs +36 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/adapters/node.d.mts +292 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/adapters/node.mjs +127 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/index.d.mts +145 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.BQXMA5bH.d.mts +298 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.By9qWDAI.mjs +9 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.CipVM6lf.mjs +3549 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.D9ehKjSh.mjs +66 -0
- package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.DfCzGthR.mjs +227 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.mjs +224 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.mjs +52 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.mjs +54 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.mjs +62 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.mjs +26 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.mjs +32 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.mjs +19 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.mjs +98 -0
- package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.mjs +15 -0
- package/dist/node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.d.mts +15 -0
- package/dist/node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs +220 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.mjs +54 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.mjs +2 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.mjs +14 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.mjs +76 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.mjs +6 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.mjs +35 -0
- package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.mjs +10 -0
- package/dist/node_modules/.pnpm/http-shutdown@1.2.2/node_modules/http-shutdown/index.mjs +76 -0
- package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.mjs +274 -0
- package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.mjs +44 -0
- package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.mjs +15 -0
- package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.mjs +23 -0
- package/dist/node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.mjs +24 -0
- package/dist/node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.mjs +18 -0
- package/dist/node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.mjs +9 -0
- package/dist/node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.mjs +20 -0
- package/dist/node_modules/.pnpm/is64bit@2.0.0/node_modules/is64bit/index.mjs +13 -0
- package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.mjs +47 -0
- package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.mjs +33 -0
- package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.mjs +33 -0
- package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/chunks/xdg-open.mjs +1070 -0
- package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/index.mjs +619 -0
- package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/shared/listhen.1c46e31d.d.mts +83 -0
- package/dist/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.mjs +38 -0
- package/dist/node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.mjs +38 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aes.mjs +597 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aesCipherSuites.mjs +195 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1-validator.mjs +76 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1.mjs +967 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/baseN.mjs +137 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipher.mjs +186 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipherModes.mjs +597 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/des.mjs +1187 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ed25519.mjs +1029 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/forge.mjs +15 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/hmac.mjs +107 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/index.mjs +66 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/jsbn.mjs +1334 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/kem.mjs +146 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/log.mjs +241 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.all.mjs +24 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.mjs +18 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md5.mjs +324 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf.mjs +20 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf1.mjs +44 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/oids.mjs +154 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbe.mjs +815 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbkdf2.mjs +125 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pem.mjs +175 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs1.mjs +200 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs12.mjs +724 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7.mjs +642 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7asn1.mjs +405 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pki.mjs +101 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prime.mjs +193 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prng.mjs +290 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pss.mjs +141 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/random.mjs +141 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rc2.mjs +538 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rsa.mjs +1309 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha1.mjs +230 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha256.mjs +267 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha512.mjs +413 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ssh.mjs +194 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/tls.mjs +3655 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/util.mjs +2117 -0
- package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/x509.mjs +2168 -0
- package/dist/node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.mjs +34 -0
- package/dist/node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.mjs +26 -0
- package/dist/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.mjs +14 -0
- package/dist/node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.mjs +8 -0
- package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs +176 -0
- package/dist/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.mjs +17 -0
- package/dist/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.mjs +8 -0
- package/dist/node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.mjs +169 -0
- package/dist/node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.mjs +33 -0
- package/dist/node_modules/.pnpm/std-env@3.10.0/node_modules/std-env/dist/index.mjs +171 -0
- package/dist/node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.mjs +10 -0
- package/dist/node_modules/.pnpm/system-architecture@0.1.0/node_modules/system-architecture/index.mjs +16 -0
- package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.node.mjs +7 -0
- package/dist/node_modules/.pnpm/untun@0.1.3/node_modules/untun/dist/chunks/index.mjs +154 -0
- package/dist/node_modules/.pnpm/untun@0.1.3/node_modules/untun/dist/index.mjs +34 -0
- package/dist/node_modules/.pnpm/uqr@0.1.2/node_modules/uqr/dist/index.mjs +896 -0
- package/dist/node_modules/.pnpm/which@2.0.2/node_modules/which/which.mjs +76 -0
- package/dist/oauth2/errors.mjs +27 -0
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.mjs +3 -3
- package/dist/oauth2/link-account.d.mts +27 -1
- package/dist/oauth2/link-account.mjs +30 -5
- package/dist/oauth2/state.mjs +8 -2
- package/dist/{package.mjs → packages/better-auth/package.mjs} +1 -1
- package/dist/plugins/access/access.d.mts +3 -15
- package/dist/plugins/access/access.mjs +11 -6
- package/dist/plugins/access/index.d.mts +2 -2
- package/dist/plugins/access/types.d.mts +11 -4
- package/dist/plugins/admin/access/statement.d.mts +29 -93
- package/dist/plugins/admin/admin.mjs +0 -4
- package/dist/plugins/admin/client.d.mts +6 -1
- package/dist/plugins/admin/client.mjs +5 -0
- package/dist/plugins/admin/routes.mjs +3 -2
- package/dist/plugins/anonymous/client.d.mts +1 -0
- package/dist/plugins/anonymous/error-codes.d.mts +1 -0
- package/dist/plugins/anonymous/error-codes.mjs +1 -0
- package/dist/plugins/anonymous/index.d.mts +1 -0
- package/dist/plugins/anonymous/index.mjs +16 -2
- package/dist/plugins/bearer/index.mjs +5 -12
- package/dist/plugins/captcha/index.mjs +14 -1
- package/dist/plugins/device-authorization/error-codes.mjs +1 -0
- package/dist/plugins/device-authorization/index.d.mts +1 -0
- package/dist/plugins/device-authorization/routes.mjs +34 -3
- package/dist/plugins/email-otp/routes.mjs +4 -4
- package/dist/plugins/generic-oauth/error-codes.mjs +0 -1
- package/dist/plugins/generic-oauth/index.d.mts +2 -4
- package/dist/plugins/generic-oauth/index.mjs +23 -17
- package/dist/plugins/generic-oauth/providers/auth0.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/gumroad.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/hubspot.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/keycloak.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/line.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/okta.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/patreon.mjs +1 -0
- package/dist/plugins/generic-oauth/providers/slack.mjs +1 -0
- package/dist/plugins/generic-oauth/types.d.mts +30 -8
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/jwt/utils.d.mts +1 -1
- package/dist/plugins/last-login-method/client.mjs +2 -2
- package/dist/plugins/magic-link/index.d.mts +8 -1
- package/dist/plugins/magic-link/index.mjs +4 -17
- package/dist/plugins/mcp/authorize.mjs +8 -2
- package/dist/plugins/mcp/index.mjs +75 -35
- package/dist/plugins/multi-session/index.mjs +2 -2
- package/dist/plugins/oauth-proxy/index.mjs +45 -32
- package/dist/plugins/oauth-proxy/utils.mjs +3 -10
- package/dist/plugins/oidc-provider/authorize.mjs +8 -2
- package/dist/plugins/oidc-provider/index.mjs +65 -38
- package/dist/plugins/one-tap/client.mjs +9 -2
- package/dist/plugins/one-tap/index.mjs +19 -36
- package/dist/plugins/open-api/generator.mjs +25 -5
- package/dist/plugins/organization/access/statement.d.mts +68 -201
- package/dist/plugins/organization/adapter.d.mts +1 -1
- package/dist/plugins/organization/adapter.mjs +65 -58
- package/dist/plugins/organization/client.d.mts +3 -1
- package/dist/plugins/organization/client.mjs +1 -1
- package/dist/plugins/organization/error-codes.d.mts +2 -0
- package/dist/plugins/organization/error-codes.mjs +3 -1
- package/dist/plugins/organization/routes/crud-access-control.d.mts +2 -2
- package/dist/plugins/organization/routes/crud-invites.d.mts +8 -1
- package/dist/plugins/organization/routes/crud-invites.mjs +8 -3
- package/dist/plugins/organization/routes/crud-org.d.mts +4 -4
- package/dist/plugins/organization/routes/crud-org.mjs +2 -2
- package/dist/plugins/organization/routes/crud-team.mjs +7 -2
- package/dist/plugins/organization/schema.d.mts +1 -1
- package/dist/plugins/organization/types.d.mts +15 -5
- package/dist/plugins/phone-number/routes.mjs +1 -1
- package/dist/plugins/siwe/client.d.mts +4 -0
- package/dist/plugins/siwe/client.mjs +5 -1
- package/dist/plugins/siwe/index.d.mts +13 -2
- package/dist/plugins/siwe/index.mjs +179 -165
- package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -3
- package/dist/plugins/two-factor/client.mjs +2 -1
- package/dist/plugins/two-factor/index.mjs +3 -2
- package/dist/plugins/username/client.d.mts +1 -0
- package/dist/plugins/username/error-codes.d.mts +1 -0
- package/dist/plugins/username/error-codes.mjs +2 -1
- package/dist/plugins/username/index.d.mts +43 -2
- package/dist/plugins/username/index.mjs +73 -6
- package/dist/state.d.mts +2 -2
- package/dist/state.mjs +18 -4
- package/dist/test-utils/headers.mjs +2 -7
- package/dist/test-utils/http-test-instance.d.mts +397 -0
- package/dist/test-utils/http-test-instance.mjs +54 -0
- package/dist/test-utils/index.d.mts +2 -1
- package/dist/test-utils/index.mjs +2 -1
- package/dist/test-utils/test-instance.d.mts +4110 -224
- package/dist/test-utils/test-instance.mjs +11 -2
- package/dist/types/auth.d.mts +4 -0
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/url.d.mts +2 -1
- package/dist/utils/url.mjs +9 -3
- package/dist/version.mjs +1 -1
- package/package.json +14 -14
- package/dist/oauth2/error-codes.d.mts +0 -20
- package/dist/plugins/generic-oauth/client.d.mts +0 -32
- package/dist/plugins/generic-oauth/client.mjs +0 -19
- package/dist/plugins/generic-oauth/error-codes.d.mts +0 -10
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseSetCookieHeader, toCookieOptions } from "../cookies/cookie-utils.mjs";
|
|
2
2
|
import { setShouldSkipSessionRefresh } from "../api/state/should-session-refresh.mjs";
|
|
3
3
|
import { PACKAGE_VERSION } from "../version.mjs";
|
|
4
|
+
import { warnIfCookiePluginNotLast } from "./cookie-plugin-guard.mjs";
|
|
4
5
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
5
6
|
//#region src/integrations/next-js.ts
|
|
6
7
|
function toNextJsHandler(auth) {
|
|
@@ -16,6 +17,7 @@ function toNextJsHandler(auth) {
|
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
const nextCookies = () => {
|
|
20
|
+
let hasWarned = false;
|
|
19
21
|
return {
|
|
20
22
|
id: "next-cookies",
|
|
21
23
|
version: PACKAGE_VERSION,
|
|
@@ -25,6 +27,10 @@ const nextCookies = () => {
|
|
|
25
27
|
return ctx.path === "/get-session";
|
|
26
28
|
},
|
|
27
29
|
handler: createAuthMiddleware(async (ctx) => {
|
|
30
|
+
if (!hasWarned) {
|
|
31
|
+
warnIfCookiePluginNotLast(ctx.context, "next-cookies");
|
|
32
|
+
hasWarned = true;
|
|
33
|
+
}
|
|
28
34
|
if ("_flag" in ctx && ctx._flag === "router") return;
|
|
29
35
|
let headersStore;
|
|
30
36
|
try {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseSetCookieHeader, toCookieOptions } from "../cookies/cookie-utils.mjs";
|
|
2
2
|
import { PACKAGE_VERSION } from "../version.mjs";
|
|
3
|
+
import { warnIfCookiePluginNotLast } from "./cookie-plugin-guard.mjs";
|
|
3
4
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
4
5
|
//#region src/integrations/svelte-kit.ts
|
|
5
6
|
const toSvelteKitHandler = (auth) => {
|
|
@@ -20,6 +21,7 @@ function isAuthPath(url, options) {
|
|
|
20
21
|
return true;
|
|
21
22
|
}
|
|
22
23
|
const sveltekitCookies = (getRequestEvent) => {
|
|
24
|
+
let hasWarned = false;
|
|
23
25
|
return {
|
|
24
26
|
id: "sveltekit-cookies",
|
|
25
27
|
version: PACKAGE_VERSION,
|
|
@@ -28,6 +30,10 @@ const sveltekitCookies = (getRequestEvent) => {
|
|
|
28
30
|
return true;
|
|
29
31
|
},
|
|
30
32
|
handler: createAuthMiddleware(async (ctx) => {
|
|
33
|
+
if (!hasWarned) {
|
|
34
|
+
warnIfCookiePluginNotLast(ctx.context, "sveltekit-cookies");
|
|
35
|
+
hasWarned = true;
|
|
36
|
+
}
|
|
31
37
|
const returned = ctx.context.responseHeaders;
|
|
32
38
|
if ("_flag" in ctx && ctx._flag === "router") return;
|
|
33
39
|
if (returned instanceof Headers) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseSetCookieHeader, toCookieOptions } from "../cookies/cookie-utils.mjs";
|
|
2
2
|
import { PACKAGE_VERSION } from "../version.mjs";
|
|
3
|
+
import { warnIfCookiePluginNotLast } from "./cookie-plugin-guard.mjs";
|
|
3
4
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
4
5
|
//#region src/integrations/tanstack-start-solid.ts
|
|
5
6
|
/**
|
|
@@ -20,6 +21,7 @@ import { createAuthMiddleware } from "@better-auth/core/api";
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
const tanstackStartCookies = () => {
|
|
24
|
+
let hasWarned = false;
|
|
23
25
|
return {
|
|
24
26
|
id: "tanstack-start-cookies-solid",
|
|
25
27
|
version: PACKAGE_VERSION,
|
|
@@ -28,6 +30,10 @@ const tanstackStartCookies = () => {
|
|
|
28
30
|
return true;
|
|
29
31
|
},
|
|
30
32
|
handler: createAuthMiddleware(async (ctx) => {
|
|
33
|
+
if (!hasWarned) {
|
|
34
|
+
warnIfCookiePluginNotLast(ctx.context, "tanstack-start-cookies-solid");
|
|
35
|
+
hasWarned = true;
|
|
36
|
+
}
|
|
31
37
|
const returned = ctx.context.responseHeaders;
|
|
32
38
|
if ("_flag" in ctx && ctx._flag === "router") return;
|
|
33
39
|
if (returned instanceof Headers) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseSetCookieHeader, toCookieOptions } from "../cookies/cookie-utils.mjs";
|
|
2
2
|
import { PACKAGE_VERSION } from "../version.mjs";
|
|
3
|
+
import { warnIfCookiePluginNotLast } from "./cookie-plugin-guard.mjs";
|
|
3
4
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
4
5
|
//#region src/integrations/tanstack-start.ts
|
|
5
6
|
/**
|
|
@@ -20,6 +21,7 @@ import { createAuthMiddleware } from "@better-auth/core/api";
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
const tanstackStartCookies = () => {
|
|
24
|
+
let hasWarned = false;
|
|
23
25
|
return {
|
|
24
26
|
id: "tanstack-start-cookies",
|
|
25
27
|
version: PACKAGE_VERSION,
|
|
@@ -28,6 +30,10 @@ const tanstackStartCookies = () => {
|
|
|
28
30
|
return true;
|
|
29
31
|
},
|
|
30
32
|
handler: createAuthMiddleware(async (ctx) => {
|
|
33
|
+
if (!hasWarned) {
|
|
34
|
+
warnIfCookiePluginNotLast(ctx.context, "tanstack-start-cookies");
|
|
35
|
+
hasWarned = true;
|
|
36
|
+
}
|
|
31
37
|
const returned = ctx.context.responseHeaders;
|
|
32
38
|
if ("_flag" in ctx && ctx._flag === "router") return;
|
|
33
39
|
if (returned instanceof Headers) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import is_wsl_default from "../../../is-wsl@3.1.1/node_modules/is-wsl/index.mjs";
|
|
2
|
+
import clipboard$1 from "./lib/termux.mjs";
|
|
3
|
+
import clipboard$2 from "./lib/linux.mjs";
|
|
4
|
+
import clipboard$3 from "./lib/macos.mjs";
|
|
5
|
+
import clipboard$4 from "./lib/windows.mjs";
|
|
6
|
+
import g$1 from "node:process";
|
|
7
|
+
//#region ../../node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/index.js
|
|
8
|
+
const platformLib = (() => {
|
|
9
|
+
switch (g$1.platform) {
|
|
10
|
+
case "darwin": return clipboard$3;
|
|
11
|
+
case "win32": return clipboard$4;
|
|
12
|
+
case "android":
|
|
13
|
+
if (g$1.env.PREFIX !== "/data/data/com.termux/files/usr") throw new Error("You need to install Termux for this module to work on Android: https://termux.com");
|
|
14
|
+
return clipboard$1;
|
|
15
|
+
default:
|
|
16
|
+
if (is_wsl_default) return clipboard$4;
|
|
17
|
+
return clipboard$2;
|
|
18
|
+
}
|
|
19
|
+
})();
|
|
20
|
+
const clipboard = {};
|
|
21
|
+
clipboard.write = async (text) => {
|
|
22
|
+
if (typeof text !== "string") throw new TypeError(`Expected a string, got ${typeof text}`);
|
|
23
|
+
await platformLib.copy({ input: text });
|
|
24
|
+
};
|
|
25
|
+
clipboard.read = async () => platformLib.paste({ stripFinalNewline: false });
|
|
26
|
+
clipboard.writeSync = (text) => {
|
|
27
|
+
if (typeof text !== "string") throw new TypeError(`Expected a string, got ${typeof text}`);
|
|
28
|
+
platformLib.copySync({ input: text });
|
|
29
|
+
};
|
|
30
|
+
clipboard.readSync = () => platformLib.pasteSync({ stripFinalNewline: false });
|
|
31
|
+
//#endregion
|
|
32
|
+
export { clipboard as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { execa, execaSync } from "../../../../execa@8.0.1/node_modules/execa/index.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region ../../node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/linux.js
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const xsel = "xsel";
|
|
7
|
+
const xselFallback = path.join(__dirname, "../fallbacks/linux/xsel");
|
|
8
|
+
const copyArguments = ["--clipboard", "--input"];
|
|
9
|
+
const pasteArguments = ["--clipboard", "--output"];
|
|
10
|
+
const makeError = (xselError, fallbackError) => {
|
|
11
|
+
let error;
|
|
12
|
+
if (xselError.code === "ENOENT") error = /* @__PURE__ */ new Error("Couldn't find the `xsel` binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel");
|
|
13
|
+
else {
|
|
14
|
+
error = /* @__PURE__ */ new Error("Both xsel and fallback failed");
|
|
15
|
+
error.xselError = xselError;
|
|
16
|
+
}
|
|
17
|
+
error.fallbackError = fallbackError;
|
|
18
|
+
return error;
|
|
19
|
+
};
|
|
20
|
+
const xselWithFallback = async (argumentList, options) => {
|
|
21
|
+
try {
|
|
22
|
+
const { stdout } = await execa(xsel, argumentList, options);
|
|
23
|
+
return stdout;
|
|
24
|
+
} catch (xselError) {
|
|
25
|
+
try {
|
|
26
|
+
const { stdout } = await execa(xselFallback, argumentList, options);
|
|
27
|
+
return stdout;
|
|
28
|
+
} catch (fallbackError) {
|
|
29
|
+
throw makeError(xselError, fallbackError);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const xselWithFallbackSync = (argumentList, options) => {
|
|
34
|
+
try {
|
|
35
|
+
return execaSync(xsel, argumentList, options).stdout;
|
|
36
|
+
} catch (xselError) {
|
|
37
|
+
try {
|
|
38
|
+
return execaSync(xselFallback, argumentList, options).stdout;
|
|
39
|
+
} catch (fallbackError) {
|
|
40
|
+
throw makeError(xselError, fallbackError);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const clipboard = {
|
|
45
|
+
async copy(options) {
|
|
46
|
+
await xselWithFallback(copyArguments, options);
|
|
47
|
+
},
|
|
48
|
+
copySync(options) {
|
|
49
|
+
xselWithFallbackSync(copyArguments, options);
|
|
50
|
+
},
|
|
51
|
+
paste: (options) => xselWithFallback(pasteArguments, options),
|
|
52
|
+
pasteSync: (options) => xselWithFallbackSync(pasteArguments, options)
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
export { clipboard as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { execa, execaSync } from "../../../../execa@8.0.1/node_modules/execa/index.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/macos.js
|
|
3
|
+
const env = { LC_CTYPE: "UTF-8" };
|
|
4
|
+
const clipboard = {
|
|
5
|
+
copy: async (options) => execa("pbcopy", {
|
|
6
|
+
...options,
|
|
7
|
+
env
|
|
8
|
+
}),
|
|
9
|
+
async paste(options) {
|
|
10
|
+
const { stdout } = await execa("pbpaste", {
|
|
11
|
+
...options,
|
|
12
|
+
env
|
|
13
|
+
});
|
|
14
|
+
return stdout;
|
|
15
|
+
},
|
|
16
|
+
copySync: (options) => execaSync("pbcopy", {
|
|
17
|
+
...options,
|
|
18
|
+
env
|
|
19
|
+
}),
|
|
20
|
+
pasteSync: (options) => execaSync("pbpaste", {
|
|
21
|
+
...options,
|
|
22
|
+
env
|
|
23
|
+
}).stdout
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { clipboard as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { execa, execaSync } from "../../../../execa@8.0.1/node_modules/execa/index.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/termux.js
|
|
3
|
+
const handler = (error) => {
|
|
4
|
+
if (error.code === "ENOENT") throw new Error("Couldn't find the termux-api scripts. You can install them with: apt install termux-api");
|
|
5
|
+
throw error;
|
|
6
|
+
};
|
|
7
|
+
const clipboard = {
|
|
8
|
+
async copy(options) {
|
|
9
|
+
try {
|
|
10
|
+
await execa("termux-clipboard-set", options);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
handler(error);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
async paste(options) {
|
|
16
|
+
try {
|
|
17
|
+
const { stdout } = await execa("termux-clipboard-get", options);
|
|
18
|
+
return stdout;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
handler(error);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
copySync(options) {
|
|
24
|
+
try {
|
|
25
|
+
execaSync("termux-clipboard-set", options);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
handler(error);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
pasteSync(options) {
|
|
31
|
+
try {
|
|
32
|
+
return execaSync("termux-clipboard-get", options).stdout;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
handler(error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { clipboard as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { execa, execaSync } from "../../../../execa@8.0.1/node_modules/execa/index.mjs";
|
|
2
|
+
import { is64bitSync } from "../../../../is64bit@2.0.0/node_modules/is64bit/index.mjs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
//#region ../../node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/windows.js
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const binarySuffix = is64bitSync() ? "x86_64" : "i686";
|
|
8
|
+
const windowBinaryPath = path.join(__dirname, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
|
|
9
|
+
const clipboard = {
|
|
10
|
+
copy: async (options) => execa(windowBinaryPath, ["--copy"], options),
|
|
11
|
+
async paste(options) {
|
|
12
|
+
const { stdout } = await execa(windowBinaryPath, ["--paste"], options);
|
|
13
|
+
return stdout;
|
|
14
|
+
},
|
|
15
|
+
copySync: (options) => execaSync(windowBinaryPath, ["--copy"], options),
|
|
16
|
+
pasteSync: (options) => execaSync(windowBinaryPath, ["--paste"], options).stdout
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { clipboard as default };
|