better-auth 1.4.6-beta.6 → 1.4.7-beta.2
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/dist/{chunk-DieNfLhd.mjs → _virtual/rolldown_runtime.mjs} +1 -12
- package/dist/adapters/drizzle-adapter/drizzle-adapter.d.mts +48 -0
- package/dist/adapters/drizzle-adapter/drizzle-adapter.mjs +286 -0
- package/dist/adapters/drizzle-adapter/drizzle-adapter.mjs.map +1 -0
- package/dist/adapters/drizzle-adapter/index.d.mts +1 -46
- package/dist/adapters/drizzle-adapter/index.mjs +1 -283
- package/dist/adapters/index.d.mts +2 -1
- package/dist/adapters/index.mjs +2 -1
- package/dist/adapters/index.mjs.map +1 -0
- package/dist/{bun-sqlite-dialect-BGIIaWxx.mjs → adapters/kysely-adapter/bun-sqlite-dialect.mjs} +2 -1
- package/dist/adapters/kysely-adapter/bun-sqlite-dialect.mjs.map +1 -0
- package/dist/adapters/kysely-adapter/dialect.d.mts +18 -0
- package/dist/{dialect-BHuPIP4Z.mjs → adapters/kysely-adapter/dialect.mjs} +4 -3
- package/dist/adapters/kysely-adapter/dialect.mjs.map +1 -0
- package/dist/adapters/kysely-adapter/index.d.mts +3 -46
- package/dist/adapters/kysely-adapter/index.mjs +2 -294
- package/dist/adapters/kysely-adapter/kysely-adapter.d.mts +36 -0
- package/dist/adapters/kysely-adapter/kysely-adapter.mjs +296 -0
- package/dist/adapters/kysely-adapter/kysely-adapter.mjs.map +1 -0
- package/dist/{node-sqlite-dialect-DL3qojbZ.mjs → adapters/kysely-adapter/node-sqlite-dialect.mjs} +2 -1
- package/dist/adapters/kysely-adapter/node-sqlite-dialect.mjs.map +1 -0
- package/dist/{types-Bde2wFm4.d.mts → adapters/kysely-adapter/types.d.mts} +2 -1
- package/dist/adapters/memory-adapter/index.d.mts +1 -13
- package/dist/adapters/memory-adapter/index.mjs +1 -210
- package/dist/adapters/memory-adapter/memory-adapter.d.mts +15 -0
- package/dist/adapters/memory-adapter/memory-adapter.mjs +213 -0
- package/dist/adapters/memory-adapter/memory-adapter.mjs.map +1 -0
- package/dist/adapters/mongodb-adapter/index.d.mts +1 -34
- package/dist/adapters/mongodb-adapter/index.mjs +1 -388
- package/dist/adapters/mongodb-adapter/mongodb-adapter.d.mts +36 -0
- package/dist/adapters/mongodb-adapter/mongodb-adapter.mjs +391 -0
- package/dist/adapters/mongodb-adapter/mongodb-adapter.mjs.map +1 -0
- package/dist/adapters/prisma-adapter/index.d.mts +1 -33
- package/dist/adapters/prisma-adapter/index.mjs +1 -215
- package/dist/adapters/prisma-adapter/prisma-adapter.d.mts +35 -0
- package/dist/adapters/prisma-adapter/prisma-adapter.mjs +218 -0
- package/dist/adapters/prisma-adapter/prisma-adapter.mjs.map +1 -0
- package/dist/adapters/test.d.mts +2 -1
- package/dist/adapters/test.mjs +3 -3
- package/dist/adapters/test.mjs.map +1 -0
- package/dist/api/index.d.mts +3860 -3
- package/dist/api/index.mjs +200 -11
- package/dist/api/index.mjs.map +1 -0
- package/dist/api/middlewares/index.d.mts +2 -0
- package/dist/api/middlewares/index.mjs +4 -0
- package/dist/api/middlewares/oauth.d.mts +18 -0
- package/dist/api/middlewares/oauth.mjs +8 -0
- package/dist/api/middlewares/oauth.mjs.map +1 -0
- package/dist/api/middlewares/origin-check.d.mts +14 -0
- package/dist/api/middlewares/origin-check.mjs +53 -0
- package/dist/api/middlewares/origin-check.mjs.map +1 -0
- package/dist/api/rate-limiter/index.mjs +160 -0
- package/dist/api/rate-limiter/index.mjs.map +1 -0
- package/dist/api/routes/account.d.mts +429 -0
- package/dist/api/routes/account.mjs +454 -0
- package/dist/api/routes/account.mjs.map +1 -0
- package/dist/api/routes/callback.d.mts +33 -0
- package/dist/api/routes/callback.mjs +176 -0
- package/dist/api/routes/callback.mjs.map +1 -0
- package/dist/api/routes/email-verification.d.mts +162 -0
- package/dist/api/routes/email-verification.mjs +291 -0
- package/dist/api/routes/email-verification.mjs.map +1 -0
- package/dist/api/routes/error.d.mts +30 -0
- package/dist/api/routes/error.mjs +386 -0
- package/dist/api/routes/error.mjs.map +1 -0
- package/dist/api/routes/index.d.mts +11 -0
- package/dist/api/routes/index.mjs +13 -0
- package/dist/api/routes/ok.d.mts +38 -0
- package/dist/api/routes/ok.mjs +30 -0
- package/dist/api/routes/ok.mjs.map +1 -0
- package/dist/api/routes/reset-password.d.mts +133 -0
- package/dist/api/routes/reset-password.mjs +169 -0
- package/dist/api/routes/reset-password.mjs.map +1 -0
- package/dist/api/routes/session.d.mts +415 -0
- package/dist/{session-DzeN0NAi.mjs → api/routes/session.mjs} +9 -4
- package/dist/api/routes/session.mjs.map +1 -0
- package/dist/api/routes/sign-in.d.mts +174 -0
- package/dist/api/routes/sign-in.mjs +252 -0
- package/dist/api/routes/sign-in.mjs.map +1 -0
- package/dist/api/routes/sign-out.d.mts +38 -0
- package/dist/api/routes/sign-out.mjs +33 -0
- package/dist/api/routes/sign-out.mjs.map +1 -0
- package/dist/api/routes/sign-up.d.mts +153 -0
- package/dist/api/routes/sign-up.mjs +218 -0
- package/dist/api/routes/sign-up.mjs.map +1 -0
- package/dist/api/routes/update-user.d.mts +452 -0
- package/dist/api/routes/update-user.mjs +494 -0
- package/dist/api/routes/update-user.mjs.map +1 -0
- package/dist/api/to-auth-endpoints.mjs +179 -0
- package/dist/api/to-auth-endpoints.mjs.map +1 -0
- package/dist/auth/auth.d.mts +15 -0
- package/dist/auth/auth.mjs +16 -0
- package/dist/auth/auth.mjs.map +1 -0
- package/dist/auth/base.mjs +43 -0
- package/dist/auth/base.mjs.map +1 -0
- package/dist/auth/index.d.mts +1 -0
- package/dist/auth/index.mjs +3 -0
- package/dist/auth/minimal.d.mts +4 -3
- package/dist/auth/minimal.mjs +4 -28
- package/dist/auth/minimal.mjs.map +1 -0
- package/dist/auth/trusted-origins.mjs +31 -0
- package/dist/auth/trusted-origins.mjs.map +1 -0
- package/dist/client/broadcast-channel.d.mts +20 -0
- package/dist/client/broadcast-channel.mjs +46 -0
- package/dist/client/broadcast-channel.mjs.map +1 -0
- package/dist/client/config.mjs +89 -0
- package/dist/client/config.mjs.map +1 -0
- package/dist/client/fetch-plugins.mjs +18 -0
- package/dist/client/fetch-plugins.mjs.map +1 -0
- package/dist/client/focus-manager.d.mts +11 -0
- package/dist/client/focus-manager.mjs +32 -0
- package/dist/client/focus-manager.mjs.map +1 -0
- package/dist/client/index.d.mts +18 -211
- package/dist/client/index.mjs +20 -5
- package/dist/client/index.mjs.map +1 -0
- package/dist/client/lynx/index.d.mts +5 -48
- package/dist/client/lynx/index.mjs +5 -48
- package/dist/client/lynx/index.mjs.map +1 -0
- package/dist/client/lynx/lynx-store.d.mts +47 -0
- package/dist/client/lynx/lynx-store.mjs +47 -0
- package/dist/client/lynx/lynx-store.mjs.map +1 -0
- package/dist/client/online-manager.d.mts +12 -0
- package/dist/client/online-manager.mjs +35 -0
- package/dist/client/online-manager.mjs.map +1 -0
- package/dist/{parser-g6CH-tVp.mjs → client/parser.mjs} +2 -1
- package/dist/client/parser.mjs.map +1 -0
- package/dist/client/path-to-object.d.mts +53 -0
- package/dist/client/plugins/index.d.mts +46 -841
- package/dist/client/plugins/index.mjs +21 -504
- package/dist/client/plugins/infer-plugin.d.mts +16 -0
- package/dist/client/plugins/infer-plugin.mjs +11 -0
- package/dist/client/plugins/infer-plugin.mjs.map +1 -0
- package/dist/client/proxy.mjs +76 -0
- package/dist/client/proxy.mjs.map +1 -0
- package/dist/client/query.d.mts +22 -0
- package/dist/client/query.mjs +98 -0
- package/dist/client/query.mjs.map +1 -0
- package/dist/client/react/index.d.mts +5 -48
- package/dist/client/react/index.mjs +5 -48
- package/dist/client/react/index.mjs.map +1 -0
- package/dist/client/react/react-store.d.mts +47 -0
- package/dist/client/react/react-store.mjs +47 -0
- package/dist/client/react/react-store.mjs.map +1 -0
- package/dist/client/session-atom.mjs +29 -0
- package/dist/client/session-atom.mjs.map +1 -0
- package/dist/client/session-refresh.d.mts +22 -0
- package/dist/client/session-refresh.mjs +122 -0
- package/dist/client/session-refresh.mjs.map +1 -0
- package/dist/client/solid/index.d.mts +4 -4
- package/dist/client/solid/index.mjs +5 -25
- package/dist/client/solid/index.mjs.map +1 -0
- package/dist/client/solid/solid-store.mjs +24 -0
- package/dist/client/solid/solid-store.mjs.map +1 -0
- package/dist/client/svelte/index.d.mts +4 -4
- package/dist/client/svelte/index.mjs +4 -4
- package/dist/client/svelte/index.mjs.map +1 -0
- package/dist/client/types.d.mts +55 -0
- package/dist/client/vanilla.d.mts +123 -0
- package/dist/{client-BJRbyWu7.mjs → client/vanilla.mjs} +4 -14
- package/dist/client/vanilla.mjs.map +1 -0
- package/dist/client/vue/index.d.mts +4 -4
- package/dist/client/vue/index.mjs +5 -27
- package/dist/client/vue/index.mjs.map +1 -0
- package/dist/client/vue/vue-store.mjs +26 -0
- package/dist/client/vue/vue-store.mjs.map +1 -0
- package/dist/{base-DXLar-6_.mjs → context/create-context.mjs} +15 -133
- package/dist/context/create-context.mjs.map +1 -0
- package/dist/context/helpers.mjs +59 -0
- package/dist/context/helpers.mjs.map +1 -0
- package/dist/context/init-minimal.mjs +21 -0
- package/dist/context/init-minimal.mjs.map +1 -0
- package/dist/{auth-CyEpSXRo.mjs → context/init.mjs} +6 -15
- package/dist/context/init.mjs.map +1 -0
- package/dist/cookies/cookie-utils.d.mts +19 -0
- package/dist/cookies/cookie-utils.mjs +66 -0
- package/dist/cookies/cookie-utils.mjs.map +1 -0
- package/dist/cookies/index.d.mts +66 -4
- package/dist/cookies/index.mjs +280 -5
- package/dist/cookies/index.mjs.map +1 -0
- package/dist/cookies/session-store.d.mts +36 -0
- package/dist/cookies/session-store.mjs +200 -0
- package/dist/cookies/session-store.mjs.map +1 -0
- package/dist/crypto/buffer.d.mts +8 -0
- package/dist/crypto/buffer.mjs +18 -0
- package/dist/crypto/buffer.mjs.map +1 -0
- package/dist/crypto/index.d.mts +7 -26
- package/dist/crypto/index.mjs +23 -2
- package/dist/crypto/index.mjs.map +1 -0
- package/dist/crypto/jwt.d.mts +8 -0
- package/dist/crypto/jwt.mjs +95 -0
- package/dist/crypto/jwt.mjs.map +1 -0
- package/dist/crypto/password.d.mts +12 -0
- package/dist/crypto/password.mjs +36 -0
- package/dist/crypto/password.mjs.map +1 -0
- package/dist/crypto/random.d.mts +5 -0
- package/dist/crypto/random.mjs +8 -0
- package/dist/crypto/random.mjs.map +1 -0
- package/dist/db/adapter-base.d.mts +8 -0
- package/dist/db/adapter-base.mjs +28 -0
- package/dist/db/adapter-base.mjs.map +1 -0
- package/dist/db/adapter-kysely.d.mts +8 -0
- package/dist/db/adapter-kysely.mjs +21 -0
- package/dist/db/adapter-kysely.mjs.map +1 -0
- package/dist/db/field-converter.d.mts +8 -0
- package/dist/db/field-converter.mjs +21 -0
- package/dist/db/field-converter.mjs.map +1 -0
- package/dist/db/field.d.mts +78 -0
- package/dist/db/field.mjs +11 -0
- package/dist/db/field.mjs.map +1 -0
- package/dist/db/get-migration.d.mts +23 -0
- package/dist/db/get-migration.mjs +339 -0
- package/dist/db/get-migration.mjs.map +1 -0
- package/dist/db/get-schema.d.mts +11 -0
- package/dist/db/get-schema.mjs +39 -0
- package/dist/db/get-schema.mjs.map +1 -0
- package/dist/db/index.d.mts +10 -2
- package/dist/db/index.mjs +40 -5
- package/dist/db/index.mjs.map +1 -0
- package/dist/db/internal-adapter.d.mts +14 -0
- package/dist/db/internal-adapter.mjs +560 -0
- package/dist/db/internal-adapter.mjs.map +1 -0
- package/dist/db/schema.d.mts +80 -0
- package/dist/{schema-dfOF7vRb.mjs → db/schema.mjs} +2 -7
- package/dist/db/schema.mjs.map +1 -0
- package/dist/db/to-zod.d.mts +36 -0
- package/dist/db/to-zod.mjs +26 -0
- package/dist/db/to-zod.mjs.map +1 -0
- package/dist/db/with-hooks.d.mts +33 -0
- package/dist/db/with-hooks.mjs +148 -0
- package/dist/db/with-hooks.mjs.map +1 -0
- package/dist/index.d.mts +37 -4
- package/dist/index.mjs +6 -14
- package/dist/integrations/next-js.d.mts +6 -5
- package/dist/integrations/next-js.mjs +5 -6
- package/dist/integrations/next-js.mjs.map +1 -0
- package/dist/integrations/node.d.mts +4 -3
- package/dist/integrations/node.mjs +2 -1
- package/dist/integrations/node.mjs.map +1 -0
- package/dist/integrations/solid-start.d.mts +2 -1
- package/dist/integrations/solid-start.mjs +2 -1
- package/dist/integrations/solid-start.mjs.map +1 -0
- package/dist/integrations/svelte-kit.d.mts +5 -5
- package/dist/integrations/svelte-kit.mjs +5 -6
- package/dist/integrations/svelte-kit.mjs.map +1 -0
- package/dist/integrations/tanstack-start.d.mts +6 -5
- package/dist/integrations/tanstack-start.mjs +5 -6
- package/dist/integrations/tanstack-start.mjs.map +1 -0
- package/dist/oauth2/index.d.mts +3 -50
- package/dist/oauth2/index.mjs +3 -10
- package/dist/oauth2/link-account.d.mts +48 -0
- package/dist/oauth2/link-account.mjs +141 -0
- package/dist/oauth2/link-account.mjs.map +1 -0
- package/dist/oauth2/state.d.mts +26 -0
- package/dist/{utils-C4Ub_EYH.mjs → oauth2/state.mjs} +5 -12
- package/dist/oauth2/state.mjs.map +1 -0
- package/dist/oauth2/utils.d.mts +8 -0
- package/dist/oauth2/utils.mjs +22 -0
- package/dist/oauth2/utils.mjs.map +1 -0
- package/dist/{index-B1fASdrI.d.mts → plugins/access/access.d.mts} +3 -14
- package/dist/{access-BCQibqkF.mjs → plugins/access/access.mjs} +2 -1
- package/dist/plugins/access/access.mjs.map +1 -0
- package/dist/plugins/access/index.d.mts +2 -1
- package/dist/plugins/access/index.mjs +1 -1
- package/dist/plugins/access/types.d.mts +17 -0
- package/dist/plugins/additional-fields/client.d.mts +96 -0
- package/dist/plugins/additional-fields/client.mjs +11 -0
- package/dist/plugins/additional-fields/client.mjs.map +1 -0
- package/dist/plugins/admin/access/index.d.mts +1 -136
- package/dist/plugins/admin/access/index.mjs +1 -2
- package/dist/plugins/admin/access/statement.d.mts +118 -0
- package/dist/{access-DZRRE6Tq.mjs → plugins/admin/access/statement.mjs} +4 -2
- package/dist/plugins/admin/access/statement.mjs.map +1 -0
- package/dist/plugins/admin/admin.d.mts +851 -0
- package/dist/plugins/admin/admin.mjs +96 -0
- package/dist/plugins/admin/admin.mjs.map +1 -0
- package/dist/plugins/admin/client.d.mts +66 -0
- package/dist/plugins/admin/client.mjs +34 -0
- package/dist/plugins/admin/client.mjs.map +1 -0
- package/dist/plugins/admin/error-codes.mjs +29 -0
- package/dist/plugins/admin/error-codes.mjs.map +1 -0
- package/dist/{has-permission-BxveqtYZ.mjs → plugins/admin/has-permission.mjs} +4 -2
- package/dist/plugins/admin/has-permission.mjs.map +1 -0
- package/dist/plugins/admin/index.d.mts +2 -22
- package/dist/plugins/admin/index.mjs +1 -15
- package/dist/{admin-B7ejdSlw.mjs → plugins/admin/routes.mjs} +11 -151
- package/dist/plugins/admin/routes.mjs.map +1 -0
- package/dist/plugins/admin/schema.d.mts +40 -0
- package/dist/plugins/admin/schema.mjs +34 -0
- package/dist/plugins/admin/schema.mjs.map +1 -0
- package/dist/plugins/admin/types.d.mts +88 -0
- package/dist/plugins/anonymous/client.d.mts +19 -0
- package/dist/plugins/anonymous/client.mjs +16 -0
- package/dist/plugins/anonymous/client.mjs.map +1 -0
- package/dist/plugins/anonymous/error-codes.mjs +13 -0
- package/dist/plugins/anonymous/error-codes.mjs.map +1 -0
- package/dist/plugins/anonymous/index.d.mts +77 -4
- package/dist/plugins/anonymous/index.mjs +109 -12
- package/dist/plugins/anonymous/index.mjs.map +1 -0
- package/dist/plugins/anonymous/schema.d.mts +16 -0
- package/dist/plugins/anonymous/schema.mjs +11 -0
- package/dist/plugins/anonymous/schema.mjs.map +1 -0
- package/dist/plugins/anonymous/types.d.mts +60 -0
- package/dist/plugins/api-key/adapter.mjs +311 -0
- package/dist/plugins/api-key/adapter.mjs.map +1 -0
- package/dist/plugins/api-key/client.d.mts +17 -0
- package/dist/plugins/api-key/client.mjs +16 -0
- package/dist/plugins/api-key/client.mjs.map +1 -0
- package/dist/plugins/api-key/index.d.mts +1112 -0
- package/dist/plugins/api-key/index.mjs +158 -0
- package/dist/plugins/api-key/index.mjs.map +1 -0
- package/dist/plugins/api-key/rate-limit.mjs +73 -0
- package/dist/plugins/api-key/rate-limit.mjs.map +1 -0
- package/dist/plugins/api-key/routes/create-api-key.mjs +250 -0
- package/dist/plugins/api-key/routes/create-api-key.mjs.map +1 -0
- package/dist/plugins/api-key/routes/delete-all-expired-api-keys.mjs +27 -0
- package/dist/plugins/api-key/routes/delete-all-expired-api-keys.mjs.map +1 -0
- package/dist/plugins/api-key/routes/delete-api-key.mjs +72 -0
- package/dist/plugins/api-key/routes/delete-api-key.mjs.map +1 -0
- package/dist/plugins/api-key/routes/get-api-key.mjs +155 -0
- package/dist/plugins/api-key/routes/get-api-key.mjs.map +1 -0
- package/dist/plugins/api-key/routes/index.mjs +71 -0
- package/dist/plugins/api-key/routes/index.mjs.map +1 -0
- package/dist/plugins/api-key/routes/list-api-keys.mjs +159 -0
- package/dist/plugins/api-key/routes/list-api-keys.mjs.map +1 -0
- package/dist/plugins/api-key/routes/update-api-key.mjs +245 -0
- package/dist/plugins/api-key/routes/update-api-key.mjs.map +1 -0
- package/dist/plugins/api-key/routes/verify-api-key.mjs +204 -0
- package/dist/plugins/api-key/routes/verify-api-key.mjs.map +1 -0
- package/dist/plugins/api-key/schema.d.mts +199 -0
- package/dist/plugins/api-key/schema.mjs +130 -0
- package/dist/plugins/api-key/schema.mjs.map +1 -0
- package/dist/plugins/api-key/types.d.mts +331 -0
- package/dist/plugins/bearer/index.d.mts +37 -2
- package/dist/plugins/bearer/index.mjs +64 -6
- package/dist/plugins/bearer/index.mjs.map +1 -0
- package/dist/plugins/captcha/constants.d.mts +11 -0
- package/dist/plugins/captcha/constants.mjs +22 -0
- package/dist/plugins/captcha/constants.mjs.map +1 -0
- package/dist/plugins/captcha/error-codes.mjs +16 -0
- package/dist/plugins/captcha/error-codes.mjs.map +1 -0
- package/dist/plugins/captcha/index.d.mts +13 -2
- package/dist/plugins/captcha/index.mjs +58 -3
- package/dist/plugins/captcha/index.mjs.map +1 -0
- package/dist/{index-CNMCZNM-.d.mts → plugins/captcha/types.d.mts} +3 -18
- package/dist/plugins/captcha/utils.mjs +11 -0
- package/dist/plugins/captcha/utils.mjs.map +1 -0
- package/dist/plugins/captcha/verify-handlers/captchafox.mjs +27 -0
- package/dist/plugins/captcha/verify-handlers/captchafox.mjs.map +1 -0
- package/dist/plugins/captcha/verify-handlers/cloudflare-turnstile.mjs +25 -0
- package/dist/plugins/captcha/verify-handlers/cloudflare-turnstile.mjs.map +1 -0
- package/dist/plugins/captcha/verify-handlers/google-recaptcha.mjs +29 -0
- package/dist/plugins/captcha/verify-handlers/google-recaptcha.mjs.map +1 -0
- package/dist/plugins/captcha/verify-handlers/h-captcha.mjs +27 -0
- package/dist/plugins/captcha/verify-handlers/h-captcha.mjs.map +1 -0
- package/dist/plugins/captcha/verify-handlers/index.mjs +6 -0
- package/dist/plugins/custom-session/client.d.mts +17 -0
- package/dist/plugins/custom-session/client.mjs +11 -0
- package/dist/plugins/custom-session/client.mjs.map +1 -0
- package/dist/plugins/custom-session/index.d.mts +67 -4
- package/dist/plugins/custom-session/index.mjs +68 -13
- package/dist/plugins/custom-session/index.mjs.map +1 -0
- package/dist/plugins/device-authorization/client.d.mts +17 -0
- package/dist/plugins/device-authorization/client.mjs +18 -0
- package/dist/plugins/device-authorization/client.mjs.map +1 -0
- package/dist/plugins/device-authorization/error-codes.mjs +21 -0
- package/dist/plugins/device-authorization/error-codes.mjs.map +1 -0
- package/dist/plugins/device-authorization/index.d.mts +394 -2
- package/dist/plugins/device-authorization/index.mjs +47 -10
- package/dist/plugins/device-authorization/index.mjs.map +1 -0
- package/dist/{device-authorization-B51s2iTw.mjs → plugins/device-authorization/routes.mjs} +6 -113
- package/dist/plugins/device-authorization/routes.mjs.map +1 -0
- package/dist/plugins/device-authorization/schema.mjs +57 -0
- package/dist/plugins/device-authorization/schema.mjs.map +1 -0
- package/dist/plugins/email-otp/client.d.mts +14 -0
- package/dist/plugins/email-otp/client.mjs +15 -0
- package/dist/plugins/email-otp/client.mjs.map +1 -0
- package/dist/plugins/email-otp/index.d.mts +391 -2
- package/dist/plugins/email-otp/index.mjs +105 -13
- package/dist/plugins/email-otp/index.mjs.map +1 -0
- package/dist/plugins/email-otp/otp-token.mjs +29 -0
- package/dist/plugins/email-otp/otp-token.mjs.map +1 -0
- package/dist/{email-otp-DO0Vrg6W.mjs → plugins/email-otp/routes.mjs} +14 -144
- package/dist/plugins/email-otp/routes.mjs.map +1 -0
- package/dist/plugins/email-otp/types.d.mts +74 -0
- package/dist/plugins/email-otp/utils.mjs +17 -0
- package/dist/plugins/email-otp/utils.mjs.map +1 -0
- package/dist/plugins/generic-oauth/client.d.mts +19 -0
- package/dist/plugins/generic-oauth/client.mjs +11 -0
- package/dist/plugins/generic-oauth/client.mjs.map +1 -0
- package/dist/plugins/generic-oauth/error-codes.mjs +15 -0
- package/dist/plugins/generic-oauth/error-codes.mjs.map +1 -0
- package/dist/plugins/generic-oauth/index.d.mts +194 -2
- package/dist/plugins/generic-oauth/index.mjs +133 -12
- package/dist/plugins/generic-oauth/index.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/auth0.d.mts +37 -0
- package/dist/plugins/generic-oauth/providers/auth0.mjs +62 -0
- package/dist/plugins/generic-oauth/providers/auth0.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/hubspot.d.mts +37 -0
- package/dist/plugins/generic-oauth/providers/hubspot.mjs +60 -0
- package/dist/plugins/generic-oauth/providers/hubspot.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/index.d.mts +7 -0
- package/dist/plugins/generic-oauth/providers/index.mjs +9 -0
- package/dist/plugins/generic-oauth/providers/keycloak.d.mts +37 -0
- package/dist/plugins/generic-oauth/providers/keycloak.mjs +62 -0
- package/dist/plugins/generic-oauth/providers/keycloak.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/line.d.mts +55 -0
- package/dist/plugins/generic-oauth/providers/line.mjs +91 -0
- package/dist/plugins/generic-oauth/providers/line.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +37 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs +66 -0
- package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/okta.d.mts +37 -0
- package/dist/plugins/generic-oauth/providers/okta.mjs +62 -0
- package/dist/plugins/generic-oauth/providers/okta.mjs.map +1 -0
- package/dist/plugins/generic-oauth/providers/slack.d.mts +30 -0
- package/dist/plugins/generic-oauth/providers/slack.mjs +61 -0
- package/dist/plugins/generic-oauth/providers/slack.mjs.map +1 -0
- package/dist/plugins/generic-oauth/routes.mjs +394 -0
- package/dist/plugins/generic-oauth/routes.mjs.map +1 -0
- package/dist/plugins/generic-oauth/types.d.mts +145 -0
- package/dist/plugins/haveibeenpwned/index.d.mts +37 -2
- package/dist/plugins/haveibeenpwned/index.mjs +53 -12
- package/dist/plugins/haveibeenpwned/index.mjs.map +1 -0
- package/dist/plugins/index.d.mts +61 -24
- package/dist/plugins/index.mjs +44 -41
- package/dist/plugins/jwt/adapter.mjs +27 -0
- package/dist/plugins/jwt/adapter.mjs.map +1 -0
- package/dist/plugins/jwt/client.d.mts +40 -0
- package/dist/plugins/jwt/client.mjs +19 -0
- package/dist/plugins/jwt/client.mjs.map +1 -0
- package/dist/plugins/jwt/index.d.mts +227 -4
- package/dist/plugins/jwt/index.mjs +207 -12
- package/dist/plugins/jwt/index.mjs.map +1 -0
- package/dist/plugins/jwt/schema.d.mts +26 -0
- package/dist/plugins/jwt/schema.mjs +23 -0
- package/dist/plugins/jwt/schema.mjs.map +1 -0
- package/dist/plugins/jwt/sign.d.mts +9 -0
- package/dist/plugins/jwt/sign.mjs +66 -0
- package/dist/plugins/jwt/sign.mjs.map +1 -0
- package/dist/plugins/jwt/types.d.mts +194 -0
- package/dist/plugins/jwt/utils.d.mts +33 -0
- package/dist/plugins/jwt/utils.mjs +64 -0
- package/dist/plugins/jwt/utils.mjs.map +1 -0
- package/dist/plugins/jwt/verify.d.mts +13 -0
- package/dist/plugins/jwt/verify.mjs +43 -0
- package/dist/plugins/jwt/verify.mjs.map +1 -0
- package/dist/plugins/last-login-method/client.d.mts +38 -0
- package/dist/plugins/last-login-method/client.mjs +32 -0
- package/dist/plugins/last-login-method/client.mjs.map +1 -0
- package/dist/plugins/last-login-method/index.d.mts +110 -0
- package/dist/plugins/last-login-method/index.mjs +81 -0
- package/dist/plugins/last-login-method/index.mjs.map +1 -0
- package/dist/plugins/magic-link/client.d.mts +10 -0
- package/dist/plugins/magic-link/client.mjs +11 -0
- package/dist/plugins/magic-link/client.mjs.map +1 -0
- package/dist/plugins/magic-link/index.d.mts +183 -2
- package/dist/plugins/magic-link/index.mjs +172 -12
- package/dist/plugins/magic-link/index.mjs.map +1 -0
- package/dist/plugins/magic-link/utils.mjs +12 -0
- package/dist/plugins/magic-link/utils.mjs.map +1 -0
- package/dist/plugins/mcp/authorize.mjs +133 -0
- package/dist/plugins/mcp/authorize.mjs.map +1 -0
- package/dist/plugins/mcp/index.d.mts +464 -0
- package/dist/plugins/mcp/index.mjs +709 -0
- package/dist/plugins/mcp/index.mjs.map +1 -0
- package/dist/plugins/multi-session/client.d.mts +14 -0
- package/dist/plugins/multi-session/client.mjs +17 -0
- package/dist/plugins/multi-session/client.mjs.map +1 -0
- package/dist/plugins/multi-session/index.d.mts +198 -2
- package/dist/plugins/multi-session/index.mjs +149 -12
- package/dist/plugins/multi-session/index.mjs.map +1 -0
- package/dist/plugins/oauth-proxy/index.d.mts +87 -2
- package/dist/plugins/oauth-proxy/index.mjs +292 -13
- package/dist/plugins/oauth-proxy/index.mjs.map +1 -0
- package/dist/plugins/oauth-proxy/utils.mjs +37 -0
- package/dist/plugins/oauth-proxy/utils.mjs.map +1 -0
- package/dist/plugins/oidc-provider/authorize.mjs +194 -0
- package/dist/plugins/oidc-provider/authorize.mjs.map +1 -0
- package/dist/plugins/oidc-provider/client.d.mts +12 -0
- package/dist/plugins/oidc-provider/client.mjs +11 -0
- package/dist/plugins/oidc-provider/client.mjs.map +1 -0
- package/dist/plugins/oidc-provider/error.mjs +17 -0
- package/dist/plugins/oidc-provider/error.mjs.map +1 -0
- package/dist/plugins/oidc-provider/index.d.mts +711 -23
- package/dist/plugins/oidc-provider/index.mjs +1087 -13
- package/dist/plugins/oidc-provider/index.mjs.map +1 -0
- package/dist/plugins/oidc-provider/schema.d.mts +160 -0
- package/dist/plugins/oidc-provider/schema.mjs +132 -0
- package/dist/plugins/oidc-provider/schema.mjs.map +1 -0
- package/dist/plugins/oidc-provider/types.d.mts +517 -0
- package/dist/plugins/oidc-provider/utils/prompt.mjs +19 -0
- package/dist/plugins/oidc-provider/utils/prompt.mjs.map +1 -0
- package/dist/plugins/oidc-provider/utils.mjs +15 -0
- package/dist/plugins/oidc-provider/utils.mjs.map +1 -0
- package/dist/plugins/one-tap/client.d.mts +104 -0
- package/dist/plugins/one-tap/client.mjs +155 -0
- package/dist/plugins/one-tap/client.mjs.map +1 -0
- package/dist/plugins/one-tap/index.d.mts +77 -2
- package/dist/plugins/one-tap/index.mjs +109 -12
- package/dist/plugins/one-tap/index.mjs.map +1 -0
- package/dist/plugins/one-time-token/client.d.mts +10 -0
- package/dist/plugins/one-time-token/client.mjs +11 -0
- package/dist/plugins/one-time-token/client.mjs.map +1 -0
- package/dist/plugins/one-time-token/index.d.mts +115 -4
- package/dist/plugins/one-time-token/index.mjs +59 -12
- package/dist/plugins/one-time-token/index.mjs.map +1 -0
- package/dist/plugins/one-time-token/utils.mjs +12 -0
- package/dist/plugins/one-time-token/utils.mjs.map +1 -0
- package/dist/{index-DZ8eC6CZ.d.mts → plugins/open-api/generator.d.mts} +2 -90
- package/dist/plugins/open-api/generator.mjs +299 -0
- package/dist/plugins/open-api/generator.mjs.map +1 -0
- package/dist/plugins/open-api/index.d.mts +93 -2
- package/dist/plugins/open-api/index.mjs +63 -12
- package/dist/plugins/open-api/index.mjs.map +1 -0
- package/dist/{open-api-BPImNq0U.mjs → plugins/open-api/logo.mjs} +2 -356
- package/dist/plugins/open-api/logo.mjs.map +1 -0
- package/dist/plugins/organization/access/index.d.mts +1 -22
- package/dist/plugins/organization/access/index.mjs +1 -2
- package/dist/plugins/organization/access/statement.d.mts +249 -0
- package/dist/{access-BktEfzR6.mjs → plugins/organization/access/statement.mjs} +4 -2
- package/dist/plugins/organization/access/statement.mjs.map +1 -0
- package/dist/plugins/organization/adapter.mjs +614 -0
- package/dist/plugins/organization/adapter.mjs.map +1 -0
- package/dist/plugins/organization/call.mjs +19 -0
- package/dist/plugins/organization/call.mjs.map +1 -0
- package/dist/plugins/organization/client.d.mts +357 -0
- package/dist/plugins/organization/client.mjs +105 -0
- package/dist/plugins/organization/client.mjs.map +1 -0
- package/dist/plugins/organization/error-codes.d.mts +62 -0
- package/dist/plugins/organization/error-codes.mjs +65 -0
- package/dist/plugins/organization/error-codes.mjs.map +1 -0
- package/dist/plugins/organization/has-permission.mjs +35 -0
- package/dist/plugins/organization/has-permission.mjs.map +1 -0
- package/dist/plugins/organization/index.d.mts +5 -22
- package/dist/plugins/organization/index.mjs +1 -14
- package/dist/plugins/organization/organization.d.mts +387 -0
- package/dist/plugins/organization/organization.mjs +427 -0
- package/dist/plugins/organization/organization.mjs.map +1 -0
- package/dist/plugins/organization/permission.d.mts +26 -0
- package/dist/{permission-BZUPzNK6.mjs → plugins/organization/permission.mjs} +2 -1
- package/dist/plugins/organization/permission.mjs.map +1 -0
- package/dist/plugins/organization/routes/crud-access-control.d.mts +322 -0
- package/dist/plugins/organization/routes/crud-access-control.mjs +655 -0
- package/dist/plugins/organization/routes/crud-access-control.mjs.map +1 -0
- package/dist/plugins/organization/routes/crud-invites.d.mts +776 -0
- package/dist/plugins/organization/routes/crud-invites.mjs +531 -0
- package/dist/plugins/organization/routes/crud-invites.mjs.map +1 -0
- package/dist/plugins/organization/routes/crud-members.d.mts +703 -0
- package/dist/plugins/organization/routes/crud-members.mjs +486 -0
- package/dist/plugins/organization/routes/crud-members.mjs.map +1 -0
- package/dist/plugins/organization/routes/crud-org.d.mts +522 -0
- package/dist/plugins/organization/routes/crud-org.mjs +442 -0
- package/dist/plugins/organization/routes/crud-org.mjs.map +1 -0
- package/dist/plugins/organization/routes/crud-team.d.mts +805 -0
- package/dist/plugins/organization/routes/crud-team.mjs +682 -0
- package/dist/plugins/organization/routes/crud-team.mjs.map +1 -0
- package/dist/plugins/organization/schema.d.mts +373 -0
- package/dist/plugins/organization/schema.mjs +68 -0
- package/dist/plugins/organization/schema.mjs.map +1 -0
- package/dist/plugins/organization/types.d.mts +719 -0
- package/dist/plugins/phone-number/client.d.mts +15 -0
- package/dist/plugins/phone-number/client.mjs +17 -0
- package/dist/plugins/phone-number/client.mjs.map +1 -0
- package/dist/plugins/phone-number/error-codes.mjs +21 -0
- package/dist/plugins/phone-number/error-codes.mjs.map +1 -0
- package/dist/plugins/phone-number/index.d.mts +311 -4
- package/dist/plugins/phone-number/index.mjs +47 -12
- package/dist/plugins/phone-number/index.mjs.map +1 -0
- package/dist/{phone-number-Blz1Bfdf.mjs → plugins/phone-number/routes.mjs} +15 -87
- package/dist/plugins/phone-number/routes.mjs.map +1 -0
- package/dist/plugins/phone-number/schema.d.mts +23 -0
- package/dist/plugins/phone-number/schema.mjs +20 -0
- package/dist/plugins/phone-number/schema.mjs.map +1 -0
- package/dist/plugins/phone-number/types.d.mts +119 -0
- package/dist/plugins/siwe/client.d.mts +10 -0
- package/dist/plugins/siwe/client.mjs +11 -0
- package/dist/plugins/siwe/client.mjs.map +1 -0
- package/dist/plugins/siwe/index.d.mts +88 -4
- package/dist/plugins/siwe/index.mjs +201 -12
- package/dist/plugins/siwe/index.mjs.map +1 -0
- package/dist/plugins/siwe/schema.d.mts +35 -0
- package/dist/plugins/siwe/schema.mjs +32 -0
- package/dist/plugins/siwe/schema.mjs.map +1 -0
- package/dist/plugins/siwe/types.d.mts +45 -0
- package/dist/plugins/two-factor/backup-codes/index.d.mts +287 -0
- package/dist/plugins/two-factor/backup-codes/index.mjs +277 -0
- package/dist/plugins/two-factor/backup-codes/index.mjs.map +1 -0
- package/dist/plugins/two-factor/client.d.mts +38 -0
- package/dist/{client-7xkXfvW4.mjs → plugins/two-factor/client.mjs} +2 -1
- package/dist/plugins/two-factor/client.mjs.map +1 -0
- package/dist/plugins/two-factor/constant.mjs +8 -0
- package/dist/plugins/two-factor/constant.mjs.map +1 -0
- package/dist/plugins/two-factor/error-code.d.mts +15 -0
- package/dist/plugins/two-factor/error-code.mjs +18 -0
- package/dist/plugins/two-factor/error-code.mjs.map +1 -0
- package/dist/plugins/two-factor/index.d.mts +680 -4
- package/dist/plugins/two-factor/index.mjs +207 -14
- package/dist/plugins/two-factor/index.mjs.map +1 -0
- package/dist/plugins/two-factor/otp/index.d.mts +217 -0
- package/dist/plugins/two-factor/otp/index.mjs +201 -0
- package/dist/plugins/two-factor/otp/index.mjs.map +1 -0
- package/dist/plugins/two-factor/schema.d.mts +41 -0
- package/dist/plugins/two-factor/schema.mjs +36 -0
- package/dist/plugins/two-factor/schema.mjs.map +1 -0
- package/dist/plugins/two-factor/totp/index.d.mts +213 -0
- package/dist/plugins/two-factor/totp/index.mjs +152 -0
- package/dist/plugins/two-factor/totp/index.mjs.map +1 -0
- package/dist/plugins/two-factor/types.d.mts +57 -0
- package/dist/plugins/two-factor/utils.mjs +12 -0
- package/dist/plugins/two-factor/utils.mjs.map +1 -0
- package/dist/plugins/two-factor/verify-two-factor.mjs +88 -0
- package/dist/plugins/two-factor/verify-two-factor.mjs.map +1 -0
- package/dist/plugins/username/client.d.mts +14 -0
- package/dist/plugins/username/client.mjs +15 -0
- package/dist/plugins/username/client.mjs.map +1 -0
- package/dist/plugins/username/error-codes.d.mts +14 -0
- package/dist/plugins/username/error-codes.mjs +17 -0
- package/dist/plugins/username/error-codes.mjs.map +1 -0
- package/dist/plugins/username/index.d.mts +245 -3
- package/dist/plugins/username/index.mjs +255 -12
- package/dist/plugins/username/index.mjs.map +1 -0
- package/dist/plugins/username/schema.d.mts +33 -0
- package/dist/plugins/username/schema.mjs +26 -0
- package/dist/plugins/username/schema.mjs.map +1 -0
- package/dist/test-utils/headers.d.mts +9 -0
- package/dist/test-utils/headers.mjs +24 -0
- package/dist/test-utils/headers.mjs.map +1 -0
- package/dist/test-utils/index.d.mts +2 -11870
- package/dist/test-utils/index.mjs +2 -264
- package/dist/test-utils/test-instance.d.mts +11871 -0
- package/dist/test-utils/test-instance.mjs +212 -0
- package/dist/test-utils/test-instance.mjs.map +1 -0
- package/dist/types/adapter.d.mts +25 -0
- package/dist/types/api.d.mts +30 -0
- package/dist/types/auth.d.mts +30 -0
- package/dist/{helper-BBvhhJRX.d.mts → types/helper.d.mts} +2 -1
- package/dist/types/index.d.mts +9 -4
- package/dist/types/models.d.mts +18 -0
- package/dist/{plugins-DLdyc73z.d.mts → types/plugins.d.mts} +3 -2
- package/dist/utils/boolean.mjs +8 -0
- package/dist/utils/boolean.mjs.map +1 -0
- package/dist/utils/constants.mjs +6 -0
- package/dist/utils/constants.mjs.map +1 -0
- package/dist/utils/date.mjs +8 -0
- package/dist/utils/date.mjs.map +1 -0
- package/dist/utils/get-request-ip.d.mts +7 -0
- package/dist/{get-request-ip-G2Tcmzbb.mjs → utils/get-request-ip.mjs} +2 -1
- package/dist/utils/get-request-ip.mjs.map +1 -0
- package/dist/utils/hashing.mjs +21 -0
- package/dist/utils/hashing.mjs.map +1 -0
- package/dist/utils/hide-metadata.d.mts +7 -0
- package/dist/utils/hide-metadata.mjs +6 -0
- package/dist/utils/hide-metadata.mjs.map +1 -0
- package/dist/utils/index.d.mts +4 -0
- package/dist/utils/index.mjs +5 -0
- package/dist/utils/is-atom.mjs +8 -0
- package/dist/utils/is-atom.mjs.map +1 -0
- package/dist/utils/is-promise.mjs +8 -0
- package/dist/utils/is-promise.mjs.map +1 -0
- package/dist/utils/middleware-response.mjs +6 -0
- package/dist/utils/middleware-response.mjs.map +1 -0
- package/dist/{password-BRmR7rWA.mjs → utils/password.mjs} +2 -1
- package/dist/utils/password.mjs.map +1 -0
- package/dist/{plugin-helper-BneBaGtD.mjs → utils/plugin-helper.mjs} +2 -1
- package/dist/utils/plugin-helper.mjs.map +1 -0
- package/dist/utils/shim.mjs +24 -0
- package/dist/utils/shim.mjs.map +1 -0
- package/dist/utils/time.mjs +59 -0
- package/dist/utils/time.mjs.map +1 -0
- package/dist/{url-B7VXiggp.mjs → utils/url.mjs} +6 -5
- package/dist/utils/url.mjs.map +1 -0
- package/dist/utils/wildcard.mjs +108 -0
- package/dist/utils/wildcard.mjs.map +1 -0
- package/package.json +43 -5
- package/dist/anonymous-DtDX1Tt1.mjs +0 -124
- package/dist/api-Btgd2bgm.mjs +0 -3225
- package/dist/bearer-C79h5z5t.mjs +0 -63
- package/dist/captcha-av_BAGRz.mjs +0 -178
- package/dist/cookies-C9MZZaJ2.mjs +0 -523
- package/dist/crypto-DgVHxgLL.mjs +0 -164
- package/dist/custom-session-CjpmKFme.mjs +0 -67
- package/dist/esm-CyZgw_uF.mjs +0 -4090
- package/dist/generic-oauth-BNvAoIN9.mjs +0 -954
- package/dist/get-migration-CDvYpogu.mjs +0 -1190
- package/dist/haveibeenpwned-DEA7QGzT.mjs +0 -53
- package/dist/index-7_n2Onxy.d.mts +0 -9319
- package/dist/index-B3CSW56D.d.mts +0 -197
- package/dist/index-B6HepD87.d.mts +0 -1503
- package/dist/index-B9_77v0f.d.mts +0 -460
- package/dist/index-BwB7s4Pk.d.mts +0 -86
- package/dist/index-C4YXDQqI.d.mts +0 -160
- package/dist/index-C6JlLkZw.d.mts +0 -6319
- package/dist/index-CTZv2mQK.d.mts +0 -283
- package/dist/index-CU9sNB4D.d.mts +0 -444
- package/dist/index-C_t-hZXK.d.mts +0 -559
- package/dist/index-CfASVIzV.d.mts +0 -471
- package/dist/index-Cg12btK0.d.mts +0 -76
- package/dist/index-CliPP00E.d.mts +0 -110
- package/dist/index-DAWHK5U0.d.mts +0 -113
- package/dist/index-Dn7rFwsf.d.mts +0 -36
- package/dist/index-DozBmQMU.d.mts +0 -393
- package/dist/index-Dv8SEq_Z.d.mts +0 -144
- package/dist/index-Dvwu5Hj9.d.mts +0 -65
- package/dist/index-NphISEhZ.d.mts +0 -182
- package/dist/index-tiYKFe5k.d.mts +0 -36
- package/dist/jwt-gFa83_p0.mjs +0 -461
- package/dist/magic-link-zRf-3e5H.mjs +0 -175
- package/dist/multi-session-Bvamjr7i.mjs +0 -148
- package/dist/oauth-proxy-Blgslqyg.mjs +0 -322
- package/dist/oidc-provider--yoKG1Rw.mjs +0 -1429
- package/dist/one-tap-1XvovR3W.mjs +0 -114
- package/dist/one-time-token-CrBN7B6D.mjs +0 -65
- package/dist/organization-BnyWu4xx.mjs +0 -3937
- package/dist/plugins-Kx4OCNqR.mjs +0 -2662
- package/dist/promise-CL99vzc3.mjs +0 -23147
- package/dist/proxy-DNjQepc2.mjs +0 -521
- package/dist/siwe-B0GnyaM0.mjs +0 -247
- package/dist/two-factor-CMqf0Z5n.mjs +0 -929
- package/dist/username-CXCisLFK.mjs +0 -289
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
import { Tt as User, rt as index_d_exports, wt as Session } from "./index-C6JlLkZw.mjs";
|
|
2
|
-
import { t as Awaitable } from "./helper-BBvhhJRX.mjs";
|
|
3
|
-
import { t as InferOptionSchema } from "./plugins-DLdyc73z.mjs";
|
|
4
|
-
import * as _better_auth_core9 from "@better-auth/core";
|
|
5
|
-
import { GenericEndpointContext } from "@better-auth/core";
|
|
6
|
-
import * as z from "zod";
|
|
7
|
-
import * as better_call197 from "better-call";
|
|
8
|
-
import * as jose0 from "jose";
|
|
9
|
-
import { JSONWebKeySet, JWTPayload } from "jose";
|
|
10
|
-
|
|
11
|
-
//#region src/plugins/jwt/schema.d.ts
|
|
12
|
-
declare const schema: {
|
|
13
|
-
jwks: {
|
|
14
|
-
fields: {
|
|
15
|
-
publicKey: {
|
|
16
|
-
type: "string";
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
privateKey: {
|
|
20
|
-
type: "string";
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
createdAt: {
|
|
24
|
-
type: "date";
|
|
25
|
-
required: true;
|
|
26
|
-
};
|
|
27
|
-
expiresAt: {
|
|
28
|
-
type: "date";
|
|
29
|
-
required: false;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/plugins/jwt/types.d.ts
|
|
36
|
-
interface JwtOptions {
|
|
37
|
-
jwks?: {
|
|
38
|
-
/**
|
|
39
|
-
* Disables the /jwks endpoint and uses this endpoint in discovery.
|
|
40
|
-
*
|
|
41
|
-
* Useful if jwks are not managed at /jwks or
|
|
42
|
-
* if your jwks are signed with a certificate and placed on your CDN.
|
|
43
|
-
*/
|
|
44
|
-
remoteUrl?: string | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Key pair configuration
|
|
47
|
-
* @description A subset of the options available for the generateKeyPair function
|
|
48
|
-
*
|
|
49
|
-
* @see https://github.com/panva/jose/blob/main/src/runtime/node/generate.ts
|
|
50
|
-
*
|
|
51
|
-
* @default { alg: 'EdDSA', crv: 'Ed25519' }
|
|
52
|
-
*/
|
|
53
|
-
keyPairConfig?: JWKOptions | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Disable private key encryption
|
|
56
|
-
* @description Disable the encryption of the private key in the database
|
|
57
|
-
*
|
|
58
|
-
* @default false
|
|
59
|
-
*/
|
|
60
|
-
disablePrivateKeyEncryption?: boolean | undefined;
|
|
61
|
-
/**
|
|
62
|
-
* The key rotation interval in seconds.
|
|
63
|
-
*
|
|
64
|
-
* @default undefined (disabled)
|
|
65
|
-
*/
|
|
66
|
-
rotationInterval?: number | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* The grace period in seconds.
|
|
69
|
-
*
|
|
70
|
-
* @default 2592000 (30 days)
|
|
71
|
-
*/
|
|
72
|
-
gracePeriod?: number | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* The path of the endpoint exposing the JWKS.
|
|
75
|
-
* When set, this replaces the default /jwks endpoint.
|
|
76
|
-
* The old endpoint will return 404.
|
|
77
|
-
*
|
|
78
|
-
* @default /jwks
|
|
79
|
-
* @example "/.well-known/jwks.json"
|
|
80
|
-
*/
|
|
81
|
-
jwksPath?: string | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
jwt?: {
|
|
84
|
-
/**
|
|
85
|
-
* The issuer of the JWT
|
|
86
|
-
*/
|
|
87
|
-
issuer?: string | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* The audience of the JWT
|
|
90
|
-
*/
|
|
91
|
-
audience?: string | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* Set the "exp" (Expiration Time) Claim.
|
|
94
|
-
*
|
|
95
|
-
* - If a `number` is passed as an argument it is used as the claim directly.
|
|
96
|
-
* - If a `Date` instance is passed as an argument it is converted to unix timestamp and used as the
|
|
97
|
-
* claim.
|
|
98
|
-
* - If a `string` is passed as an argument it is resolved to a time span, and then added to the
|
|
99
|
-
* current unix timestamp and used as the claim.
|
|
100
|
-
*
|
|
101
|
-
* Format used for time span should be a number followed by a unit, such as "5 minutes" or "1
|
|
102
|
-
* day".
|
|
103
|
-
*
|
|
104
|
-
* Valid units are: "sec", "secs", "second", "seconds", "s", "minute", "minutes", "min", "mins",
|
|
105
|
-
* "m", "hour", "hours", "hr", "hrs", "h", "day", "days", "d", "week", "weeks", "w", "year",
|
|
106
|
-
* "years", "yr", "yrs", and "y". It is not possible to specify months. 365.25 days is used as an
|
|
107
|
-
* alias for a year.
|
|
108
|
-
*
|
|
109
|
-
* If the string is suffixed with "ago", or prefixed with a "-", the resulting time span gets
|
|
110
|
-
* subtracted from the current unix timestamp. A "from now" suffix can also be used for
|
|
111
|
-
* readability when adding to the current unix timestamp.
|
|
112
|
-
*
|
|
113
|
-
* @default 15m
|
|
114
|
-
*/
|
|
115
|
-
expirationTime?: number | string | Date | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* A function that is called to define the payload of the JWT
|
|
118
|
-
*/
|
|
119
|
-
definePayload?: (session: {
|
|
120
|
-
user: User & Record<string, any>;
|
|
121
|
-
session: Session & Record<string, any>;
|
|
122
|
-
}) => Promise<Record<string, any>> | Record<string, any> | undefined;
|
|
123
|
-
/**
|
|
124
|
-
* A function that is called to get the subject of the JWT
|
|
125
|
-
*
|
|
126
|
-
* @default session.user.id
|
|
127
|
-
*/
|
|
128
|
-
getSubject?: (session: {
|
|
129
|
-
user: User & Record<string, any>;
|
|
130
|
-
session: Session & Record<string, any>;
|
|
131
|
-
}) => Promise<string> | string | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* A custom function to remote sign the jwt payload.
|
|
134
|
-
*
|
|
135
|
-
* All headers, such as `alg` and `kid`,
|
|
136
|
-
* MUST be defined within this function.
|
|
137
|
-
* You can safely define the header `typ: 'JWT'`.
|
|
138
|
-
*
|
|
139
|
-
* @requires jwks.remoteUrl
|
|
140
|
-
* @invalidates other jwt.* options
|
|
141
|
-
*/
|
|
142
|
-
sign?: ((payload: JWTPayload) => Awaitable<string>) | undefined;
|
|
143
|
-
} | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* Disables setting JWTs through middleware.
|
|
146
|
-
*
|
|
147
|
-
* Recommended to set `true` when using an oAuth provider plugin
|
|
148
|
-
* like OIDC or MCP where session payloads should not be signed.
|
|
149
|
-
*
|
|
150
|
-
* @default false
|
|
151
|
-
*/
|
|
152
|
-
disableSettingJwtHeader?: boolean | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* Custom schema for the admin plugin
|
|
155
|
-
*/
|
|
156
|
-
schema?: InferOptionSchema<typeof schema> | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* Custom adapter for the jwt plugin
|
|
159
|
-
*
|
|
160
|
-
* This will override the default adapter
|
|
161
|
-
*
|
|
162
|
-
* @default adapter from the database
|
|
163
|
-
*/
|
|
164
|
-
adapter?: {
|
|
165
|
-
/**
|
|
166
|
-
* A custom function to get the JWKS from the database or
|
|
167
|
-
* other source
|
|
168
|
-
*
|
|
169
|
-
* This will override the default getJwks from the database
|
|
170
|
-
*
|
|
171
|
-
* @param ctx - The context of the request
|
|
172
|
-
* @returns The JWKS
|
|
173
|
-
*/
|
|
174
|
-
getJwks?: (ctx: index_d_exports.GenericEndpointContext) => Promise<Jwk[] | null | undefined>;
|
|
175
|
-
/**
|
|
176
|
-
* A custom function to create a new key in the database or
|
|
177
|
-
* other source
|
|
178
|
-
*
|
|
179
|
-
* This will override the default createJwk from the database
|
|
180
|
-
*
|
|
181
|
-
* @param data - The key to create
|
|
182
|
-
* @returns The created key
|
|
183
|
-
*/
|
|
184
|
-
createJwk?: (data: Omit<Jwk, "id">, ctx: index_d_exports.GenericEndpointContext) => Promise<Jwk>;
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Asymmetric (JWS) Supported.
|
|
189
|
-
*
|
|
190
|
-
* @see https://github.com/panva/jose/issues/210
|
|
191
|
-
*/
|
|
192
|
-
type JWKOptions = {
|
|
193
|
-
alg: "EdDSA";
|
|
194
|
-
crv?: "Ed25519" | undefined;
|
|
195
|
-
} | {
|
|
196
|
-
alg: "ES256";
|
|
197
|
-
crv?: never | undefined;
|
|
198
|
-
} | {
|
|
199
|
-
alg: "ES512";
|
|
200
|
-
crv?: never | undefined;
|
|
201
|
-
} | {
|
|
202
|
-
alg: "PS256";
|
|
203
|
-
modulusLength?: number | undefined;
|
|
204
|
-
} | {
|
|
205
|
-
alg: "RS256";
|
|
206
|
-
modulusLength?: number | undefined;
|
|
207
|
-
};
|
|
208
|
-
type JWSAlgorithms = JWKOptions["alg"];
|
|
209
|
-
interface Jwk {
|
|
210
|
-
id: string;
|
|
211
|
-
publicKey: string;
|
|
212
|
-
privateKey: string;
|
|
213
|
-
createdAt: Date;
|
|
214
|
-
expiresAt?: Date;
|
|
215
|
-
alg?: JWSAlgorithms | undefined;
|
|
216
|
-
crv?: ("Ed25519" | "P-256" | "P-521") | undefined;
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region src/plugins/jwt/sign.d.ts
|
|
220
|
-
declare function getJwtToken(ctx: GenericEndpointContext, options?: JwtOptions | undefined): Promise<string>;
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region src/plugins/jwt/utils.d.ts
|
|
223
|
-
declare function generateExportedKeyPair(options?: JwtOptions | undefined): Promise<{
|
|
224
|
-
publicWebKey: jose0.JWK;
|
|
225
|
-
privateWebKey: jose0.JWK;
|
|
226
|
-
alg: "EdDSA" | "ES256" | "ES512" | "PS256" | "RS256";
|
|
227
|
-
cfg: {
|
|
228
|
-
crv?: "Ed25519" | undefined;
|
|
229
|
-
} | {
|
|
230
|
-
crv?: never | undefined;
|
|
231
|
-
} | {
|
|
232
|
-
crv?: never | undefined;
|
|
233
|
-
} | {
|
|
234
|
-
modulusLength?: number | undefined;
|
|
235
|
-
} | {
|
|
236
|
-
modulusLength?: number | undefined;
|
|
237
|
-
};
|
|
238
|
-
}>;
|
|
239
|
-
/**
|
|
240
|
-
* Creates a Jwk on the database
|
|
241
|
-
*
|
|
242
|
-
* @param ctx
|
|
243
|
-
* @param options
|
|
244
|
-
* @returns
|
|
245
|
-
*/
|
|
246
|
-
declare function createJwk(ctx: GenericEndpointContext, options?: JwtOptions | undefined): Promise<Jwk>;
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region src/plugins/jwt/verify.d.ts
|
|
249
|
-
/**
|
|
250
|
-
* Verify a JWT token using the JWKS public keys
|
|
251
|
-
* Returns the payload if valid, null otherwise
|
|
252
|
-
*/
|
|
253
|
-
declare function verifyJWT<T extends JWTPayload = JWTPayload>(token: string, options?: JwtOptions): Promise<(T & Required<Pick<JWTPayload, "sub" | "aud">>) | null>;
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/plugins/jwt/index.d.ts
|
|
256
|
-
declare const jwt: (options?: JwtOptions | undefined) => {
|
|
257
|
-
id: "jwt";
|
|
258
|
-
options: JwtOptions | undefined;
|
|
259
|
-
endpoints: {
|
|
260
|
-
getJwks: better_call197.StrictEndpoint<string, {
|
|
261
|
-
method: "GET";
|
|
262
|
-
metadata: {
|
|
263
|
-
openapi: {
|
|
264
|
-
operationId: string;
|
|
265
|
-
description: string;
|
|
266
|
-
responses: {
|
|
267
|
-
"200": {
|
|
268
|
-
description: string;
|
|
269
|
-
content: {
|
|
270
|
-
"application/json": {
|
|
271
|
-
schema: {
|
|
272
|
-
type: "object";
|
|
273
|
-
properties: {
|
|
274
|
-
keys: {
|
|
275
|
-
type: string;
|
|
276
|
-
description: string;
|
|
277
|
-
items: {
|
|
278
|
-
type: string;
|
|
279
|
-
properties: {
|
|
280
|
-
kid: {
|
|
281
|
-
type: string;
|
|
282
|
-
description: string;
|
|
283
|
-
};
|
|
284
|
-
kty: {
|
|
285
|
-
type: string;
|
|
286
|
-
description: string;
|
|
287
|
-
};
|
|
288
|
-
alg: {
|
|
289
|
-
type: string;
|
|
290
|
-
description: string;
|
|
291
|
-
};
|
|
292
|
-
use: {
|
|
293
|
-
type: string;
|
|
294
|
-
description: string;
|
|
295
|
-
enum: string[];
|
|
296
|
-
nullable: boolean;
|
|
297
|
-
};
|
|
298
|
-
n: {
|
|
299
|
-
type: string;
|
|
300
|
-
description: string;
|
|
301
|
-
nullable: boolean;
|
|
302
|
-
};
|
|
303
|
-
e: {
|
|
304
|
-
type: string;
|
|
305
|
-
description: string;
|
|
306
|
-
nullable: boolean;
|
|
307
|
-
};
|
|
308
|
-
crv: {
|
|
309
|
-
type: string;
|
|
310
|
-
description: string;
|
|
311
|
-
nullable: boolean;
|
|
312
|
-
};
|
|
313
|
-
x: {
|
|
314
|
-
type: string;
|
|
315
|
-
description: string;
|
|
316
|
-
nullable: boolean;
|
|
317
|
-
};
|
|
318
|
-
y: {
|
|
319
|
-
type: string;
|
|
320
|
-
description: string;
|
|
321
|
-
nullable: boolean;
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
required: string[];
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
required: string[];
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
};
|
|
332
|
-
};
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
};
|
|
336
|
-
} & {
|
|
337
|
-
use: any[];
|
|
338
|
-
}, JSONWebKeySet>;
|
|
339
|
-
getToken: better_call197.StrictEndpoint<"/token", {
|
|
340
|
-
method: "GET";
|
|
341
|
-
requireHeaders: true;
|
|
342
|
-
use: ((inputContext: better_call197.MiddlewareInputContext<better_call197.MiddlewareOptions>) => Promise<{
|
|
343
|
-
session: {
|
|
344
|
-
session: Record<string, any> & {
|
|
345
|
-
id: string;
|
|
346
|
-
createdAt: Date;
|
|
347
|
-
updatedAt: Date;
|
|
348
|
-
userId: string;
|
|
349
|
-
expiresAt: Date;
|
|
350
|
-
token: string;
|
|
351
|
-
ipAddress?: string | null | undefined;
|
|
352
|
-
userAgent?: string | null | undefined;
|
|
353
|
-
};
|
|
354
|
-
user: Record<string, any> & {
|
|
355
|
-
id: string;
|
|
356
|
-
createdAt: Date;
|
|
357
|
-
updatedAt: Date;
|
|
358
|
-
email: string;
|
|
359
|
-
emailVerified: boolean;
|
|
360
|
-
name: string;
|
|
361
|
-
image?: string | null | undefined;
|
|
362
|
-
};
|
|
363
|
-
};
|
|
364
|
-
}>)[];
|
|
365
|
-
metadata: {
|
|
366
|
-
openapi: {
|
|
367
|
-
operationId: string;
|
|
368
|
-
description: string;
|
|
369
|
-
responses: {
|
|
370
|
-
200: {
|
|
371
|
-
description: string;
|
|
372
|
-
content: {
|
|
373
|
-
"application/json": {
|
|
374
|
-
schema: {
|
|
375
|
-
type: "object";
|
|
376
|
-
properties: {
|
|
377
|
-
token: {
|
|
378
|
-
type: string;
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
};
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
};
|
|
387
|
-
};
|
|
388
|
-
} & {
|
|
389
|
-
use: any[];
|
|
390
|
-
}, {
|
|
391
|
-
token: string;
|
|
392
|
-
}>;
|
|
393
|
-
signJWT: better_call197.StrictEndpoint<"/sign-jwt", {
|
|
394
|
-
method: "POST";
|
|
395
|
-
metadata: {
|
|
396
|
-
SERVER_ONLY: true;
|
|
397
|
-
$Infer: {
|
|
398
|
-
body: {
|
|
399
|
-
payload: JWTPayload;
|
|
400
|
-
overrideOptions?: JwtOptions | undefined;
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
body: z.ZodObject<{
|
|
405
|
-
payload: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
406
|
-
overrideOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
407
|
-
}, z.core.$strip>;
|
|
408
|
-
} & {
|
|
409
|
-
use: any[];
|
|
410
|
-
}, {
|
|
411
|
-
token: string;
|
|
412
|
-
}>;
|
|
413
|
-
verifyJWT: better_call197.StrictEndpoint<"/verify-jwt", {
|
|
414
|
-
method: "POST";
|
|
415
|
-
metadata: {
|
|
416
|
-
SERVER_ONLY: true;
|
|
417
|
-
$Infer: {
|
|
418
|
-
body: {
|
|
419
|
-
token: string;
|
|
420
|
-
issuer?: string;
|
|
421
|
-
};
|
|
422
|
-
response: {
|
|
423
|
-
payload: {
|
|
424
|
-
sub: string;
|
|
425
|
-
aud: string;
|
|
426
|
-
[key: string]: any;
|
|
427
|
-
} | null;
|
|
428
|
-
};
|
|
429
|
-
};
|
|
430
|
-
};
|
|
431
|
-
body: z.ZodObject<{
|
|
432
|
-
token: z.ZodString;
|
|
433
|
-
issuer: z.ZodOptional<z.ZodString>;
|
|
434
|
-
}, z.core.$strip>;
|
|
435
|
-
} & {
|
|
436
|
-
use: any[];
|
|
437
|
-
}, {
|
|
438
|
-
payload: (JWTPayload & Required<Pick<JWTPayload, "sub" | "aud">>) | null;
|
|
439
|
-
}>;
|
|
440
|
-
};
|
|
441
|
-
hooks: {
|
|
442
|
-
after: {
|
|
443
|
-
matcher(context: _better_auth_core9.HookEndpointContext): boolean;
|
|
444
|
-
handler: (inputContext: better_call197.MiddlewareInputContext<better_call197.MiddlewareOptions>) => Promise<void>;
|
|
445
|
-
}[];
|
|
446
|
-
};
|
|
447
|
-
schema: {
|
|
448
|
-
jwks: {
|
|
449
|
-
fields: {
|
|
450
|
-
publicKey: {
|
|
451
|
-
type: "string";
|
|
452
|
-
required: true;
|
|
453
|
-
};
|
|
454
|
-
privateKey: {
|
|
455
|
-
type: "string";
|
|
456
|
-
required: true;
|
|
457
|
-
};
|
|
458
|
-
createdAt: {
|
|
459
|
-
type: "date";
|
|
460
|
-
required: true;
|
|
461
|
-
};
|
|
462
|
-
expiresAt: {
|
|
463
|
-
type: "date";
|
|
464
|
-
required: false;
|
|
465
|
-
};
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
};
|
|
469
|
-
};
|
|
470
|
-
//#endregion
|
|
471
|
-
export { getJwtToken as a, Jwk as c, generateExportedKeyPair as i, JwtOptions as l, verifyJWT as n, JWKOptions as o, createJwk as r, JWSAlgorithms as s, jwt as t };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import * as better_call214 from "better-call";
|
|
3
|
-
|
|
4
|
-
//#region src/plugins/one-tap/index.d.ts
|
|
5
|
-
interface OneTapOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Disable the signup flow
|
|
8
|
-
*
|
|
9
|
-
* @default false
|
|
10
|
-
*/
|
|
11
|
-
disableSignup?: boolean | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Google Client ID
|
|
14
|
-
*
|
|
15
|
-
* If a client ID is provided in the social provider configuration,
|
|
16
|
-
* it will be used.
|
|
17
|
-
*/
|
|
18
|
-
clientId?: string | undefined;
|
|
19
|
-
}
|
|
20
|
-
declare const oneTap: (options?: OneTapOptions | undefined) => {
|
|
21
|
-
id: "one-tap";
|
|
22
|
-
endpoints: {
|
|
23
|
-
oneTapCallback: better_call214.StrictEndpoint<"/one-tap/callback", {
|
|
24
|
-
method: "POST";
|
|
25
|
-
body: z.ZodObject<{
|
|
26
|
-
idToken: z.ZodString;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
metadata: {
|
|
29
|
-
openapi: {
|
|
30
|
-
summary: string;
|
|
31
|
-
description: string;
|
|
32
|
-
responses: {
|
|
33
|
-
200: {
|
|
34
|
-
description: string;
|
|
35
|
-
content: {
|
|
36
|
-
"application/json": {
|
|
37
|
-
schema: {
|
|
38
|
-
type: "object";
|
|
39
|
-
properties: {
|
|
40
|
-
session: {
|
|
41
|
-
$ref: string;
|
|
42
|
-
};
|
|
43
|
-
user: {
|
|
44
|
-
$ref: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
400: {
|
|
52
|
-
description: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
} & {
|
|
58
|
-
use: any[];
|
|
59
|
-
}, {
|
|
60
|
-
error: string;
|
|
61
|
-
} | {
|
|
62
|
-
token: string;
|
|
63
|
-
user: {
|
|
64
|
-
id: string;
|
|
65
|
-
email: string;
|
|
66
|
-
emailVerified: boolean;
|
|
67
|
-
name: string;
|
|
68
|
-
image: string | null | undefined;
|
|
69
|
-
createdAt: Date;
|
|
70
|
-
updatedAt: Date;
|
|
71
|
-
};
|
|
72
|
-
}>;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
export { oneTap as t };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { Tt as User, wt as Session } from "./index-C6JlLkZw.mjs";
|
|
2
|
-
import { BetterAuthCookies, BetterAuthOptions, GenericEndpointContext } from "@better-auth/core";
|
|
3
|
-
import "zod";
|
|
4
|
-
import { CookieOptions } from "better-call";
|
|
5
|
-
|
|
6
|
-
//#region src/cookies/cookie-utils.d.ts
|
|
7
|
-
interface CookieAttributes {
|
|
8
|
-
value: string;
|
|
9
|
-
"max-age"?: number | undefined;
|
|
10
|
-
expires?: Date | undefined;
|
|
11
|
-
domain?: string | undefined;
|
|
12
|
-
path?: string | undefined;
|
|
13
|
-
secure?: boolean | undefined;
|
|
14
|
-
httponly?: boolean | undefined;
|
|
15
|
-
samesite?: ("strict" | "lax" | "none") | undefined;
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
declare function parseSetCookieHeader(setCookie: string): Map<string, CookieAttributes>;
|
|
19
|
-
declare function setCookieToHeader(headers: Headers): (context: {
|
|
20
|
-
response: Response;
|
|
21
|
-
}) => void;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/cookies/session-store.d.ts
|
|
24
|
-
interface Cookie {
|
|
25
|
-
name: string;
|
|
26
|
-
value: string;
|
|
27
|
-
options: CookieOptions;
|
|
28
|
-
}
|
|
29
|
-
declare const createSessionStore: (cookieName: string, cookieOptions: CookieOptions, ctx: GenericEndpointContext) => {
|
|
30
|
-
/**
|
|
31
|
-
* Get the full session data by joining all chunks
|
|
32
|
-
*/
|
|
33
|
-
getValue(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Check if there are existing chunks
|
|
36
|
-
*/
|
|
37
|
-
hasChunks(): boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Chunk a cookie value and return all cookies to set (including cleanup cookies)
|
|
40
|
-
*/
|
|
41
|
-
chunk(value: string, options?: Partial<CookieOptions>): Cookie[];
|
|
42
|
-
/**
|
|
43
|
-
* Get cookies to clean up all chunks
|
|
44
|
-
*/
|
|
45
|
-
clean(): Cookie[];
|
|
46
|
-
/**
|
|
47
|
-
* Set all cookies in the context
|
|
48
|
-
*/
|
|
49
|
-
setCookies(cookies: Cookie[]): void;
|
|
50
|
-
};
|
|
51
|
-
declare function getChunkedCookie(ctx: GenericEndpointContext, cookieName: string): string | null;
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/cookies/index.d.ts
|
|
54
|
-
declare function createCookieGetter(options: BetterAuthOptions): (cookieName: string, overrideAttributes?: Partial<CookieOptions>) => {
|
|
55
|
-
name: string;
|
|
56
|
-
attributes: CookieOptions;
|
|
57
|
-
};
|
|
58
|
-
declare function getCookies(options: BetterAuthOptions): {
|
|
59
|
-
sessionToken: {
|
|
60
|
-
name: string;
|
|
61
|
-
options: CookieOptions;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* This cookie is used to store the session data in the cookie
|
|
65
|
-
* This is useful for when you want to cache the session in the cookie
|
|
66
|
-
*/
|
|
67
|
-
sessionData: {
|
|
68
|
-
name: string;
|
|
69
|
-
options: CookieOptions;
|
|
70
|
-
};
|
|
71
|
-
dontRememberToken: {
|
|
72
|
-
name: string;
|
|
73
|
-
options: CookieOptions;
|
|
74
|
-
};
|
|
75
|
-
accountData: {
|
|
76
|
-
name: string;
|
|
77
|
-
options: CookieOptions;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
declare function setCookieCache(ctx: GenericEndpointContext, session: {
|
|
81
|
-
session: Session & Record<string, any>;
|
|
82
|
-
user: User;
|
|
83
|
-
}, dontRememberMe: boolean): Promise<void>;
|
|
84
|
-
declare function setSessionCookie(ctx: GenericEndpointContext, session: {
|
|
85
|
-
session: Session & Record<string, any>;
|
|
86
|
-
user: User;
|
|
87
|
-
}, dontRememberMe?: boolean | undefined, overrides?: Partial<CookieOptions> | undefined): Promise<void>;
|
|
88
|
-
declare function deleteSessionCookie(ctx: GenericEndpointContext, skipDontRememberMe?: boolean | undefined): void;
|
|
89
|
-
declare function parseCookies(cookieHeader: string): Map<string, string>;
|
|
90
|
-
type EligibleCookies = (string & {}) | (keyof BetterAuthCookies & {});
|
|
91
|
-
declare const getSessionCookie: (request: Request | Headers, config?: {
|
|
92
|
-
cookiePrefix?: string;
|
|
93
|
-
cookieName?: string;
|
|
94
|
-
path?: string;
|
|
95
|
-
} | undefined) => string | null;
|
|
96
|
-
declare const getCookieCache: <S extends {
|
|
97
|
-
session: Session & Record<string, any>;
|
|
98
|
-
user: User & Record<string, any>;
|
|
99
|
-
updatedAt: number;
|
|
100
|
-
version?: string;
|
|
101
|
-
}>(request: Request | Headers, config?: {
|
|
102
|
-
cookiePrefix?: string;
|
|
103
|
-
cookieName?: string;
|
|
104
|
-
isSecure?: boolean;
|
|
105
|
-
secret?: string;
|
|
106
|
-
strategy?: "compact" | "jwt" | "jwe";
|
|
107
|
-
version?: string | ((session: Session & Record<string, any>, user: User & Record<string, any>) => string) | ((session: Session & Record<string, any>, user: User & Record<string, any>) => Promise<string>);
|
|
108
|
-
} | undefined) => Promise<S | null>;
|
|
109
|
-
//#endregion
|
|
110
|
-
export { getCookies as a, setCookieCache as c, getChunkedCookie as d, parseSetCookieHeader as f, getCookieCache as i, setSessionCookie as l, createCookieGetter as n, getSessionCookie as o, setCookieToHeader as p, deleteSessionCookie as r, parseCookies as s, EligibleCookies as t, createSessionStore as u };
|