payload-auth 1.0.1 → 1.1.0
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/authjs/index.d.ts +1 -0
- package/dist/authjs/index.d.ts.map +1 -0
- package/dist/authjs/index.js +1 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +1 -1
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +1 -1
- package/dist/better-auth/adapter/generate-schema/index.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/index.js +3 -3
- package/dist/better-auth/adapter/generate-schema/utils.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/utils.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/utils.js +1 -1
- package/dist/better-auth/adapter/index.d.ts +3 -2
- package/dist/better-auth/adapter/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/index.js +115 -69
- package/dist/better-auth/adapter/transform/index.d.ts +19 -6
- package/dist/better-auth/adapter/transform/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/transform/index.js +387 -96
- package/dist/better-auth/adapter/types.d.ts +3 -1
- package/dist/better-auth/adapter/types.d.ts.map +1 -0
- package/dist/better-auth/adapter/types.js +1 -1
- package/dist/better-auth/index.d.ts +1 -0
- package/dist/better-auth/index.d.ts.map +1 -0
- package/dist/better-auth/index.js +1 -1
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/check-passkey-plugin.js +5 -0
- package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/check-username-plugin.js +5 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +1 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +8 -8
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +8 -0
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-admin-access.js +22 -0
- package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts +14 -0
- package/dist/better-auth/plugin/helpers/get-admin-routes.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-admin-routes.js +6 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +6 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.js +20 -0
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +2 -1
- package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-ip.js +14 -14
- package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/get-requst-collection.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-requst-collection.js +14 -0
- package/dist/better-auth/plugin/helpers/index.d.ts +2 -1
- package/dist/better-auth/plugin/helpers/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/index.js +2 -2
- package/dist/better-auth/plugin/{lib → helpers}/prepare-session-data.d.ts +3 -2
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +42 -0
- package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts +3 -2
- package/dist/better-auth/plugin/helpers/serialize-cookie.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/serialize-cookie.js +34 -34
- package/dist/better-auth/plugin/index.d.ts +8 -7
- package/dist/better-auth/plugin/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/index.js +145 -37
- package/dist/better-auth/plugin/{collections → lib/build-collections}/accounts/hooks/sync-password-to-user.d.ts +2 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +47 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +159 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +11 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +8 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +107 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js +196 -0
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts +12 -0
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/index.js +96 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.js +91 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.js +43 -0
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/members.js +71 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +98 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +113 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +67 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.js +59 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js +108 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +8 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.js +123 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +83 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.js +45 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.js +56 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +8 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +52 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/forgot-password.js +96 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +13 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +67 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/login.js +115 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +110 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/reset-password.js +62 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +42 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +79 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.js +153 -0
- package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/after-login.d.ts +2 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +75 -0
- package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/after-logout.d.ts +2 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +74 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +45 -0
- package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/before-login.d.ts +2 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +18 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +14 -0
- package/dist/better-auth/plugin/{collections → lib/build-collections}/users/hooks/sync-account.d.ts +2 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +82 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +8 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.js +345 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +8 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +31 -0
- package/dist/better-auth/plugin/lib/{payload-access.d.ts → build-collections/utils/payload-access.d.ts} +2 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +64 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.js +63 -0
- package/dist/better-auth/plugin/lib/{config.d.ts → constants.d.ts} +14 -0
- package/dist/better-auth/plugin/lib/constants.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/constants.js +56 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +3 -2
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js +2 -2
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts +5 -4
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.js +26 -43
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +5 -3
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js +6 -6
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +8 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +17 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +118 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +58 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +86 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +17 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +17 -0
- package/dist/better-auth/plugin/lib/{ensure-password-set-before-create.d.ts → sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts} +2 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +23 -0
- package/dist/better-auth/plugin/lib/{password.d.ts → sanitize-better-auth-options/utils/password.d.ts} +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +62 -0
- package/dist/better-auth/plugin/lib/{respect-save-to-jwt-fields-middleware.d.ts → sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts} +6 -5
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +30 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +8 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +115 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.scss +31 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +11 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +196 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +131 -0
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts +14 -0
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.js +111 -0
- package/dist/better-auth/plugin/payload/components/admin-social-provider-buttons/index.scss +51 -0
- package/dist/better-auth/plugin/payload/components/form-header/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/form-header/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/form-header/index.js +23 -0
- package/dist/better-auth/plugin/payload/components/form-header/index.scss +8 -0
- package/dist/better-auth/plugin/payload/components/icons.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/icons.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/icons.js +437 -0
- package/dist/better-auth/plugin/payload/components/logo.d.ts +4 -1
- package/dist/better-auth/plugin/payload/components/logo.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/logo.js +22 -34
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts +6 -0
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/logout-button.js +27 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +7 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.js +8 -0
- package/dist/better-auth/plugin/payload/components/styles.css +2 -2
- package/dist/better-auth/plugin/payload/components/token-field.d.ts +5 -0
- package/dist/better-auth/plugin/payload/components/token-field.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/token-field.js +30 -0
- package/dist/better-auth/plugin/payload/exports/client.d.ts +7 -3
- package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/exports/client.js +7 -4
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +10 -5
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js +10 -6
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +3 -0
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +8 -0
- package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts +15 -0
- package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/utils/generate-metadata.js +74 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts +2 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +23 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts +12 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/client.js +92 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts +11 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/index.js +84 -0
- package/dist/better-auth/plugin/payload/views/admin-invite/index.scss +25 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts +14 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/client.js +95 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts +11 -3
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.js +124 -92
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.scss +29 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +8 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.js +119 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js +69 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.scss +0 -0
- package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts +5 -0
- package/dist/better-auth/plugin/payload/views/inactivity/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/inactivity/index.js +12 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts +9 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/login-field.js +54 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts +1 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.js +121 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/index.scss +31 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts +56 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/form/fields/password/types.js +3 -0
- package/dist/better-auth/plugin/payload/views/login/form/index.d.ts +17 -0
- package/dist/better-auth/plugin/payload/views/login/form/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/form/index.js +137 -0
- package/dist/better-auth/plugin/payload/views/login/form/index.scss +23 -0
- package/dist/better-auth/plugin/payload/views/login/index.d.ts +11 -4
- package/dist/better-auth/plugin/payload/views/login/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/login/index.js +81 -61
- package/dist/better-auth/plugin/payload/views/login/index.scss +10 -0
- package/dist/better-auth/plugin/payload/views/logout/client.d.ts +8 -0
- package/dist/better-auth/plugin/payload/views/logout/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/logout/client.js +76 -0
- package/dist/better-auth/plugin/payload/views/logout/index.d.ts +8 -0
- package/dist/better-auth/plugin/payload/views/logout/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/logout/index.js +14 -0
- package/dist/better-auth/plugin/payload/views/logout/index.scss +0 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +7 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.js +72 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +5 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.js +81 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.scss +9 -0
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts +3 -0
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/reset-password/metadata.js +11 -0
- package/dist/better-auth/plugin/types.d.ts +171 -33
- package/dist/better-auth/plugin/types.d.ts.map +1 -0
- package/dist/better-auth/plugin/types.js +1 -1
- package/dist/better-auth/types.d.ts +1 -0
- package/dist/better-auth/types.d.ts.map +1 -0
- package/dist/better-auth/types.js +1 -1
- package/dist/clerk/admin-ui.d.ts +4 -0
- package/dist/clerk/admin-ui.d.ts.map +1 -0
- package/dist/clerk/admin-ui.js +5 -0
- package/dist/clerk/index.d.ts +7 -1
- package/dist/clerk/index.d.ts.map +1 -0
- package/dist/clerk/index.js +7 -2
- package/dist/clerk/plugin/auth-strategy.d.ts +11 -0
- package/dist/clerk/plugin/auth-strategy.d.ts.map +1 -0
- package/dist/clerk/plugin/auth-strategy.js +45 -0
- package/dist/clerk/plugin/collections/users/access.d.ts +14 -0
- package/dist/clerk/plugin/collections/users/access.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/access.js +36 -0
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts +14 -0
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.js +108 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.d.ts +4 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.js +5 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.d.ts +13 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.js +33 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.d.ts +11 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.js +27 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.d.ts +13 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.js +35 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.d.ts +12 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.js +86 -0
- package/dist/clerk/plugin/collections/users/fields.d.ts +6 -0
- package/dist/clerk/plugin/collections/users/fields.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/fields.js +81 -0
- package/dist/clerk/plugin/collections/users/index.d.ts +10 -0
- package/dist/clerk/plugin/collections/users/index.d.ts.map +1 -0
- package/dist/clerk/plugin/collections/users/index.js +95 -0
- package/dist/clerk/plugin/components/after-login-form.d.ts +4 -0
- package/dist/clerk/plugin/components/after-login-form.d.ts.map +1 -0
- package/dist/clerk/plugin/components/after-login-form.js +65 -0
- package/dist/clerk/plugin/components/logout-button.d.ts +2 -0
- package/dist/clerk/plugin/components/logout-button.d.ts.map +1 -0
- package/dist/clerk/plugin/components/logout-button.js +49 -0
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts +6 -0
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts.map +1 -0
- package/dist/clerk/plugin/components/sync-clerk-users-button.js +75 -0
- package/dist/clerk/plugin.d.ts +6 -0
- package/dist/clerk/plugin.d.ts.map +1 -0
- package/dist/clerk/plugin.js +63 -0
- package/dist/clerk/types.d.ts +63 -0
- package/dist/clerk/types.d.ts.map +1 -0
- package/dist/clerk/types.js +3 -0
- package/dist/clerk/utils/clerk-user.d.ts +21 -0
- package/dist/clerk/utils/clerk-user.d.ts.map +1 -0
- package/dist/clerk/utils/clerk-user.js +45 -0
- package/dist/clerk/utils/index.d.ts +4 -0
- package/dist/clerk/utils/index.d.ts.map +1 -0
- package/dist/clerk/utils/index.js +5 -0
- package/dist/clerk/utils/load-clerk-instance.d.ts +8 -0
- package/dist/clerk/utils/load-clerk-instance.d.ts.map +1 -0
- package/dist/clerk/utils/load-clerk-instance.js +11 -0
- package/dist/clerk/utils/svix.d.ts +9 -0
- package/dist/clerk/utils/svix.d.ts.map +1 -0
- package/dist/clerk/utils/svix.js +40 -0
- package/dist/clerk/utils/user.d.ts +17 -0
- package/dist/clerk/utils/user.d.ts.map +1 -0
- package/dist/clerk/utils/user.js +46 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -5
- package/dist/kinde/index.d.ts +1 -0
- package/dist/kinde/index.d.ts.map +1 -0
- package/dist/kinde/index.js +1 -1
- package/package.json +44 -18
- package/LICENSE.md +0 -17
- package/dist/authjs/index.js.map +0 -1
- package/dist/better-auth/adapter/dev/bin/run.d.ts +0 -1
- package/dist/better-auth/adapter/dev/bin/run.js +0 -64
- package/dist/better-auth/adapter/dev/bin/run.js.map +0 -1
- package/dist/better-auth/adapter/dev/bin/schema.d.ts +0 -22
- package/dist/better-auth/adapter/dev/bin/schema.js +0 -160
- package/dist/better-auth/adapter/dev/bin/schema.js.map +0 -1
- package/dist/better-auth/adapter/dev/collections.d.ts +0 -3
- package/dist/better-auth/adapter/dev/collections.js +0 -212
- package/dist/better-auth/adapter/dev/collections.js.map +0 -1
- package/dist/better-auth/adapter/dev/index.d.ts +0 -3
- package/dist/better-auth/adapter/dev/index.js +0 -168
- package/dist/better-auth/adapter/dev/index.js.map +0 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js.map +0 -1
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js.map +0 -1
- package/dist/better-auth/adapter/generate-schema/index.js.map +0 -1
- package/dist/better-auth/adapter/generate-schema/utils.js.map +0 -1
- package/dist/better-auth/adapter/index.js.map +0 -1
- package/dist/better-auth/adapter/test/adapter.test.d.ts +0 -1
- package/dist/better-auth/adapter/test/adapter.test.js +0 -181
- package/dist/better-auth/adapter/test/adapter.test.js.map +0 -1
- package/dist/better-auth/adapter/test/better-auth-adapter-test.d.ts +0 -7
- package/dist/better-auth/adapter/test/better-auth-adapter-test.js +0 -425
- package/dist/better-auth/adapter/test/better-auth-adapter-test.js.map +0 -1
- package/dist/better-auth/adapter/test/schema.test.d.ts +0 -1
- package/dist/better-auth/adapter/test/schema.test.js +0 -796
- package/dist/better-auth/adapter/test/schema.test.js.map +0 -1
- package/dist/better-auth/adapter/test/test_payload1/schema.d.ts +0 -23
- package/dist/better-auth/adapter/test/test_payload1/schema.js +0 -177
- package/dist/better-auth/adapter/test/test_payload1/schema.js.map +0 -1
- package/dist/better-auth/adapter/test/test_payload2/schema.d.ts +0 -23
- package/dist/better-auth/adapter/test/test_payload2/schema.js +0 -167
- package/dist/better-auth/adapter/test/test_payload2/schema.js.map +0 -1
- package/dist/better-auth/adapter/test/test_payload3/schema.d.ts +0 -23
- package/dist/better-auth/adapter/test/test_payload3/schema.js +0 -198
- package/dist/better-auth/adapter/test/test_payload3/schema.js.map +0 -1
- package/dist/better-auth/adapter/transform/index.js.map +0 -1
- package/dist/better-auth/adapter/types.js.map +0 -1
- package/dist/better-auth/index.js.map +0 -1
- package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.js +0 -47
- package/dist/better-auth/plugin/collections/accounts/hooks/sync-password-to-user.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.d.ts +0 -6
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.js +0 -106
- package/dist/better-auth/plugin/collections/users/endpoints/refresh-token.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/after-login.js +0 -71
- package/dist/better-auth/plugin/collections/users/hooks/after-login.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/after-logout.js +0 -49
- package/dist/better-auth/plugin/collections/users/hooks/after-logout.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/before-login.js +0 -18
- package/dist/better-auth/plugin/collections/users/hooks/before-login.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.d.ts +0 -5
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.js +0 -33
- package/dist/better-auth/plugin/collections/users/hooks/clean-up-user-after-delete.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.d.ts +0 -2
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.js +0 -14
- package/dist/better-auth/plugin/collections/users/hooks/on-verified-change.js.map +0 -1
- package/dist/better-auth/plugin/collections/users/hooks/sync-account.js +0 -82
- package/dist/better-auth/plugin/collections/users/hooks/sync-account.js.map +0 -1
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js.map +0 -1
- package/dist/better-auth/plugin/helpers/get-ip.js.map +0 -1
- package/dist/better-auth/plugin/helpers/index.js.map +0 -1
- package/dist/better-auth/plugin/helpers/serialize-cookie.js.map +0 -1
- package/dist/better-auth/plugin/index.js.map +0 -1
- package/dist/better-auth/plugin/lib/auth-strategy.d.ts +0 -8
- package/dist/better-auth/plugin/lib/auth-strategy.js +0 -48
- package/dist/better-auth/plugin/lib/auth-strategy.js.map +0 -1
- package/dist/better-auth/plugin/lib/build-collection-configs.d.ts +0 -11
- package/dist/better-auth/plugin/lib/build-collection-configs.js +0 -1558
- package/dist/better-auth/plugin/lib/build-collection-configs.js.map +0 -1
- package/dist/better-auth/plugin/lib/config.js +0 -43
- package/dist/better-auth/plugin/lib/config.js.map +0 -1
- package/dist/better-auth/plugin/lib/ensure-password-set-before-create.js +0 -24
- package/dist/better-auth/plugin/lib/ensure-password-set-before-create.js.map +0 -1
- package/dist/better-auth/plugin/lib/get-payload-auth.js.map +0 -1
- package/dist/better-auth/plugin/lib/get-required-collection-slugs.js.map +0 -1
- package/dist/better-auth/plugin/lib/init-better-auth.js.map +0 -1
- package/dist/better-auth/plugin/lib/password.js +0 -63
- package/dist/better-auth/plugin/lib/password.js.map +0 -1
- package/dist/better-auth/plugin/lib/payload-access.js +0 -64
- package/dist/better-auth/plugin/lib/payload-access.js.map +0 -1
- package/dist/better-auth/plugin/lib/prepare-session-data.js +0 -42
- package/dist/better-auth/plugin/lib/prepare-session-data.js.map +0 -1
- package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.js +0 -30
- package/dist/better-auth/plugin/lib/respect-save-to-jwt-fields-middleware.js.map +0 -1
- package/dist/better-auth/plugin/lib/sanitize-auth-options.d.ts +0 -5
- package/dist/better-auth/plugin/lib/sanitize-auth-options.js +0 -298
- package/dist/better-auth/plugin/lib/sanitize-auth-options.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/admin-buttons.d.ts +0 -5
- package/dist/better-auth/plugin/payload/components/admin-buttons.js +0 -222
- package/dist/better-auth/plugin/payload/components/admin-buttons.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/login-redirect.d.ts +0 -1
- package/dist/better-auth/plugin/payload/components/login-redirect.js +0 -6
- package/dist/better-auth/plugin/payload/components/login-redirect.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/logo.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/logout.d.ts +0 -1
- package/dist/better-auth/plugin/payload/components/logout.js +0 -61
- package/dist/better-auth/plugin/payload/components/logout.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/sign-in.d.ts +0 -3
- package/dist/better-auth/plugin/payload/components/sign-in.js +0 -384
- package/dist/better-auth/plugin/payload/components/sign-in.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/sign-up.d.ts +0 -6
- package/dist/better-auth/plugin/payload/components/sign-up.js +0 -502
- package/dist/better-auth/plugin/payload/components/sign-up.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/button.d.ts +0 -10
- package/dist/better-auth/plugin/payload/components/ui/button.js +0 -42
- package/dist/better-auth/plugin/payload/components/ui/button.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/card.d.ts +0 -9
- package/dist/better-auth/plugin/payload/components/ui/card.js +0 -55
- package/dist/better-auth/plugin/payload/components/ui/card.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/checkbox.d.ts +0 -4
- package/dist/better-auth/plugin/payload/components/ui/checkbox.js +0 -23
- package/dist/better-auth/plugin/payload/components/ui/checkbox.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/cn.d.ts +0 -2
- package/dist/better-auth/plugin/payload/components/ui/cn.js +0 -7
- package/dist/better-auth/plugin/payload/components/ui/cn.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/input.d.ts +0 -3
- package/dist/better-auth/plugin/payload/components/ui/input.js +0 -14
- package/dist/better-auth/plugin/payload/components/ui/input.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/label.d.ts +0 -4
- package/dist/better-auth/plugin/payload/components/ui/label.js +0 -15
- package/dist/better-auth/plugin/payload/components/ui/label.js.map +0 -1
- package/dist/better-auth/plugin/payload/components/ui/password-input.d.ts +0 -2
- package/dist/better-auth/plugin/payload/components/ui/password-input.js +0 -55
- package/dist/better-auth/plugin/payload/components/ui/password-input.js.map +0 -1
- package/dist/better-auth/plugin/payload/exports/client.js.map +0 -1
- package/dist/better-auth/plugin/payload/exports/rsc.js.map +0 -1
- package/dist/better-auth/plugin/payload/views/create-first-admin/index.js.map +0 -1
- package/dist/better-auth/plugin/payload/views/login/index.js.map +0 -1
- package/dist/better-auth/plugin/types.js.map +0 -1
- package/dist/better-auth/types.js.map +0 -1
- package/dist/clerk/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/kinde/index.js.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BasePayload } from "payload";
|
|
2
2
|
import type { AdapterInstance } from "better-auth";
|
|
3
3
|
export type PayloadAdapterOptions = {
|
|
4
|
+
idType: "number" | "text";
|
|
4
5
|
enableDebugLogs?: boolean;
|
|
5
6
|
};
|
|
6
|
-
export type PayloadAdapter = (payloadClient: BasePayload | Promise<BasePayload> | (() => Promise<BasePayload>), config
|
|
7
|
+
export type PayloadAdapter = (payloadClient: BasePayload | Promise<BasePayload> | (() => Promise<BasePayload>), config: PayloadAdapterOptions) => AdapterInstance;
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/better-auth/adapter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAC3B,aAAa,EACT,WAAW,GACX,OAAO,CAAC,WAAW,CAAC,GACpB,CAAC,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC,EAChC,MAAM,EAAE,qBAAqB,KAC1B,eAAe,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { };
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9hZGFwdGVyL3R5cGVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQmFzZVBheWxvYWQgfSBmcm9tIFwicGF5bG9hZFwiO1xuaW1wb3J0IHR5cGUgeyBBZGFwdGVySW5zdGFuY2UgfSBmcm9tIFwiYmV0dGVyLWF1dGhcIjtcblxuZXhwb3J0IHR5cGUgUGF5bG9hZEFkYXB0ZXJPcHRpb25zID0ge1xuICBpZFR5cGU6IFwibnVtYmVyXCIgfCBcInRleHRcIjtcbiAgZW5hYmxlRGVidWdMb2dzPzogYm9vbGVhbjtcbn07XG5cbmV4cG9ydCB0eXBlIFBheWxvYWRBZGFwdGVyID0gKFxuICBwYXlsb2FkQ2xpZW50OlxuICAgIHwgQmFzZVBheWxvYWRcbiAgICB8IFByb21pc2U8QmFzZVBheWxvYWQ+XG4gICAgfCAoKCkgPT4gUHJvbWlzZTxCYXNlUGF5bG9hZD4pLFxuICBjb25maWc6IFBheWxvYWRBZGFwdGVyT3B0aW9uc1xuKSA9PiBBZGFwdGVySW5zdGFuY2U7Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBLFdBTXFCIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/better-auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
|
@@ -2,4 +2,4 @@ export * from './adapter';
|
|
|
2
2
|
export * from './plugin';
|
|
3
3
|
export * from './types';
|
|
4
4
|
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iZXR0ZXItYXV0aC9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2FkYXB0ZXInXG5leHBvcnQgKiBmcm9tICcuL3BsdWdpbidcbmV4cG9ydCAqIGZyb20gJy4vdHlwZXMnIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsWUFBVztBQUN6QixjQUFjLFdBQVU7QUFDeEIsY0FBYyxVQUFTIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-passkey-plugin.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/check-passkey-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,WAErE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function checkPasskeyPlugin(options) {
|
|
2
|
+
return options.plugins?.some((plugin)=>plugin.id === "passkey") || false;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9jaGVjay1wYXNza2V5LXBsdWdpbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gXCIuLi90eXBlc1wiO1xuXG5leHBvcnQgZnVuY3Rpb24gY2hlY2tQYXNza2V5UGx1Z2luKG9wdGlvbnM6IFNhbml0aXplZEJldHRlckF1dGhPcHRpb25zKSB7XG4gIHJldHVybiBvcHRpb25zLnBsdWdpbnM/LnNvbWUoKHBsdWdpbikgPT4gcGx1Z2luLmlkID09PSBcInBhc3NrZXlcIikgfHwgZmFsc2U7XG59XG4iXSwibmFtZXMiOlsiY2hlY2tQYXNza2V5UGx1Z2luIiwib3B0aW9ucyIsInBsdWdpbnMiLCJzb21lIiwicGx1Z2luIiwiaWQiXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sU0FBU0EsbUJBQW1CQyxPQUFtQztJQUNwRSxPQUFPQSxRQUFRQyxPQUFPLEVBQUVDLEtBQUssQ0FBQ0MsU0FBV0EsT0FBT0MsRUFBRSxLQUFLLGNBQWM7QUFDdkUifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-username-plugin.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/check-username-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,WAEtE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function checkUsernamePlugin(options) {
|
|
2
|
+
return options.plugins?.some((plugin)=>plugin.id === "username") || false;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9jaGVjay11c2VybmFtZS1wbHVnaW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU2FuaXRpemVkQmV0dGVyQXV0aE9wdGlvbnMgfSBmcm9tIFwiLi4vdHlwZXNcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGNoZWNrVXNlcm5hbWVQbHVnaW4ob3B0aW9uczogU2FuaXRpemVkQmV0dGVyQXV0aE9wdGlvbnMpIHtcbiAgcmV0dXJuIG9wdGlvbnMucGx1Z2lucz8uc29tZSgocGx1Z2luKSA9PiBwbHVnaW4uaWQgPT09IFwidXNlcm5hbWVcIikgfHwgZmFsc2U7XG59XG4iXSwibmFtZXMiOlsiY2hlY2tVc2VybmFtZVBsdWdpbiIsIm9wdGlvbnMiLCJwbHVnaW5zIiwic29tZSIsInBsdWdpbiIsImlkIl0sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLFNBQVNBLG9CQUFvQkMsT0FBbUM7SUFDckUsT0FBT0EsUUFBUUMsT0FBTyxFQUFFQyxLQUFLLENBQUNDLFNBQVdBLE9BQU9DLEVBQUUsS0FBSyxlQUFlO0FBQ3hFIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-verify-email-url.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/generate-verify-email-url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,GAAU,gEAM1C;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,KAAG,OAAO,CAAC,MAAM,CA4BjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SignJWT } from
|
|
1
|
+
import { SignJWT } from "jose";
|
|
2
2
|
/**
|
|
3
3
|
* Generates a verification URL for email verification
|
|
4
4
|
*
|
|
@@ -20,15 +20,15 @@ import { SignJWT } from 'jose';
|
|
|
20
20
|
* verifyRouteUrl: 'https://your-app.com/api/auth/verify-email',
|
|
21
21
|
* callbackURL: '/profile'
|
|
22
22
|
* });
|
|
23
|
-
*/ export const generateVerifyEmailUrl = async ({ userEmail, secret, expiresIn = 3600, verifyRouteUrl, callbackURL =
|
|
23
|
+
*/ export const generateVerifyEmailUrl = async ({ userEmail, secret, expiresIn = 3600, verifyRouteUrl, callbackURL = "/" })=>{
|
|
24
24
|
if (!userEmail) {
|
|
25
|
-
throw new Error(
|
|
25
|
+
throw new Error("userEmail is required to generate a verification URL");
|
|
26
26
|
}
|
|
27
27
|
if (!secret) {
|
|
28
|
-
throw new Error(
|
|
28
|
+
throw new Error("secret is required to sign the JWT token");
|
|
29
29
|
}
|
|
30
30
|
if (!verifyRouteUrl) {
|
|
31
|
-
throw new Error(
|
|
31
|
+
throw new Error("verifyRouteUrl is required to generate a verification URL");
|
|
32
32
|
}
|
|
33
33
|
// Create and sign the JWT token
|
|
34
34
|
const jwt = await new SignJWT({
|
|
@@ -36,11 +36,11 @@ import { SignJWT } from 'jose';
|
|
|
36
36
|
iat: Math.floor(Date.now() / 1000),
|
|
37
37
|
exp: Math.floor(Date.now() / 1000) + expiresIn
|
|
38
38
|
}).setProtectedHeader({
|
|
39
|
-
alg:
|
|
39
|
+
alg: "HS256"
|
|
40
40
|
}).sign(new TextEncoder().encode(secret));
|
|
41
41
|
// Build the verification URL
|
|
42
|
-
const verifyUrl = `${verifyRouteUrl}?token=${jwt}${callbackURL ? `&callbackURL=${encodeURIComponent(callbackURL)}` :
|
|
42
|
+
const verifyUrl = `${verifyRouteUrl}?token=${jwt}${callbackURL ? `&callbackURL=${encodeURIComponent(callbackURL)}` : ""}`;
|
|
43
43
|
return verifyUrl;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZW5lcmF0ZS12ZXJpZnktZW1haWwtdXJsLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFNpZ25KV1QgfSBmcm9tIFwiam9zZVwiO1xuXG4vKipcbiAqIEdlbmVyYXRlcyBhIHZlcm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EVBQ05DLFlBQVksSUFBSSxFQUNoQkMsY0FBYyxFQUNkQyxjQUFjLEdBQUcsRUFPbEI7SUFDQyxJQUFJLENBQUNKLFdBQVc7UUFDZCxNQUFNLElBQUlLLE1BQU07SUFDbEI7SUFFQSxJQUFJLENBQUNKLFFBQVE7UUFDWCxNQUFNLElBQUlJLE1BQU07SUFDbEI7SUFFQSxJQUFJLENBQUNGLGdCQUFnQjtRQUNuQixNQUFNLElBQUlFLE1BQ1I7SUFFSjtJQUVBLGdDQUFnQztJQUNoQyxNQUFNQyxNQUFNLE1BQU0sSUFBSVIsUUFBUTtRQUM1QlMsT0FBT1A7UUFDUFEsS0FBS0MsS0FBS0MsS0FBSyxDQUFDQyxLQUFLQyxHQUFHLEtBQUs7UUFDN0JDLEtBQUtKLEtBQUtDLEtBQUssQ0FBQ0MsS0FBS0MsR0FBRyxLQUFLLFFBQVFWO0lBQ3ZDLEdBQ0dZLGtCQUFrQixDQUFDO1FBQUVDLEtBQUs7SUFBUSxHQUNsQ0MsSUFBSSxDQUFDLElBQUlDLGNBQWNDLE1BQU0sQ0FBQ2pCO0lBRWpDLDZCQUE2QjtJQUM3QixNQUFNa0IsWUFBWSxHQUFHaEIsZUFBZSxPQUFPLEVBQUVHLE1BQU1GLGNBQWMsQ0FBQyxhQUFhLEVBQUVnQixtQkFBbUJoQixjQUFjLEdBQUcsSUFBSTtJQUV6SCxPQUFPZTtBQUNULEVBQUUifQ==
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BetterAuthPluginOptions } from "..";
|
|
2
|
+
export declare function getAdminAccess(pluginOptions: BetterAuthPluginOptions): {
|
|
3
|
+
create: import("payload").FieldAccess;
|
|
4
|
+
read: import("payload").FieldAccess;
|
|
5
|
+
update: import("payload").FieldAccess;
|
|
6
|
+
delete: import("payload").FieldAccess;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=get-admin-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-admin-access.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/get-admin-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,IAAI,CAAC;AAG7C,wBAAgB,cAAc,CAAC,aAAa,EAAE,uBAAuB;;;;;EAgBpE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isAdminWithRoles } from "../lib/build-collections/utils/payload-access";
|
|
2
|
+
export function getAdminAccess(pluginOptions) {
|
|
3
|
+
const adminRoles = pluginOptions.users?.adminRoles ?? [
|
|
4
|
+
"admin"
|
|
5
|
+
];
|
|
6
|
+
return {
|
|
7
|
+
create: isAdminWithRoles({
|
|
8
|
+
adminRoles
|
|
9
|
+
}),
|
|
10
|
+
read: isAdminWithRoles({
|
|
11
|
+
adminRoles
|
|
12
|
+
}),
|
|
13
|
+
update: isAdminWithRoles({
|
|
14
|
+
adminRoles
|
|
15
|
+
}),
|
|
16
|
+
delete: isAdminWithRoles({
|
|
17
|
+
adminRoles
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZXQtYWRtaW4tYWNjZXNzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJldHRlckF1dGhQbHVnaW5PcHRpb25zIH0gZnJvbSBcIi4uXCI7XG5pbXBvcnQgeyBpc0FkbWluV2l0aFJvbGVzIH0gZnJvbSBcIi4uL2xpYi9idWlsZC1jb2xsZWN0aW9ucy91dGlscy9wYXlsb2FkLWFjY2Vzc1wiO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0QWRtaW5BY2Nlc3MocGx1Z2luT3B0aW9uczogQmV0dGVyQXV0aFBsdWdpbk9wdGlvbnMpIHtcbiAgY29uc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|
5
|
+
readonly resetPassword: string;
|
|
6
|
+
readonly login: string;
|
|
7
|
+
readonly loginRedirect: string;
|
|
8
|
+
readonly logout: string;
|
|
9
|
+
readonly createFirstAdmin: string;
|
|
10
|
+
readonly adminInvite: string;
|
|
11
|
+
readonly verifyEmail: string;
|
|
12
|
+
readonly inactivity: string;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=get-admin-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-admin-routes.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/get-admin-routes.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE;;;;;;;;;;EAG5D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function getAdminRoutes(custom) {
|
|
2
|
+
const typedCustom = custom;
|
|
3
|
+
return typedCustom.betterAuth.adminRoutes;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZXQtYWRtaW4tcm91dGVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbmZpZ0FkbWluQ3VzdG9tIH0gZnJvbSBcIi4uL3R5cGVzXCI7XG5cbmV4cG9ydCBmdW5jdGlvbiBnZXRBZG1pblJvdXRlcyhjdXN0b206IHsgW2tleTogc3RyaW5nXTogYW55IH0pIHtcbiAgY29uc3QgdHlwZWRDdXN0b20gPSBjdXN0b20gYXMgQ29uZmlnQWRtaW5DdXN0b207XG4gIHJldHVybiB0eXBlZEN1c3RvbS5iZXR0ZXJBdXRoLmFkbWluUm91dGVzO1xufVxuIl0sIm5hbWVzIjpbImdldEFkbWluUm91dGVzIiwiY3VzdG9tIiwidHlwZWRDdXN0b20iLCJiZXR0ZXJBdXRoIiwiYWRtaW5Sb3V0ZXMiXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sU0FBU0EsZUFBZUMsTUFBOEI7SUFDM0QsTUFBTUMsY0FBY0Q7SUFDcEIsT0FBT0MsWUFBWUMsVUFBVSxDQUFDQyxXQUFXO0FBQzNDIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-all-roles.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/get-all-roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,uBAAuB;;;IAavE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function getAllRoleOptions(pluginOptions) {
|
|
2
|
+
const adminRoles = pluginOptions.users?.adminRoles ?? [
|
|
3
|
+
"admin"
|
|
4
|
+
];
|
|
5
|
+
const roles = pluginOptions.users?.roles ?? [
|
|
6
|
+
"user"
|
|
7
|
+
];
|
|
8
|
+
const allRoleOptions = [
|
|
9
|
+
...new Set([
|
|
10
|
+
...adminRoles,
|
|
11
|
+
...roles
|
|
12
|
+
])
|
|
13
|
+
].map((role)=>({
|
|
14
|
+
label: role.split(/[-_\s]/).map((word)=>word.charAt(0).toUpperCase() + word.slice(1)).join(" "),
|
|
15
|
+
value: role
|
|
16
|
+
}));
|
|
17
|
+
return allRoleOptions;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZXQtYWxsLXJvbGVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJldHRlckF1dGhQbHVnaW5PcHRpb25zIH0gZnJvbSBcIi4u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CxjQUFjRSxLQUFLLEVBQUVDLFNBQVM7UUFBQztLQUFPO0lBQ3BELE1BQU1DLGlCQUFpQjtXQUFJLElBQUlDLElBQUk7ZUFBSUo7ZUFBZUU7U0FBTTtLQUFFLENBQUNHLEdBQUcsQ0FDaEUsQ0FBQ0MsT0FBVSxDQUFBO1lBQ1RDLE9BQU9ELEtBQ0pFLEtBQUssQ0FBQyxVQUNOSCxHQUFHLENBQUMsQ0FBQ0ksT0FBU0EsS0FBS0MsTUFBTSxDQUFDLEdBQUdDLFdBQVcsS0FBS0YsS0FBS0csS0FBSyxDQUFDLElBQ3hEQyxJQUFJLENBQUM7WUFDUkMsT0FBT1I7UUFDVCxDQUFBO0lBRUYsT0FBT0g7QUFDVCJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-ip.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/get-ip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,wBAAgB,KAAK,CACnB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,iBAAiB,GACzB,MAAM,GAAG,IAAI,CAgCf"}
|
|
@@ -2,30 +2,30 @@ export function getIp(headers, options) {
|
|
|
2
2
|
if (options.advanced?.ipAddress?.disableIpTracking) {
|
|
3
3
|
return null;
|
|
4
4
|
}
|
|
5
|
-
const testIP =
|
|
6
|
-
if ((process.env.NODE_ENV ===
|
|
5
|
+
const testIP = "127.0.0.1";
|
|
6
|
+
if ((process.env.NODE_ENV === "test" || process.env.NODE_ENV === "development") ?? false) {
|
|
7
7
|
return testIP;
|
|
8
8
|
}
|
|
9
9
|
const ipHeaders = options.advanced?.ipAddress?.ipAddressHeaders;
|
|
10
10
|
const keys = ipHeaders || [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
"x-client-ip",
|
|
12
|
+
"x-forwarded-for",
|
|
13
|
+
"cf-connecting-ip",
|
|
14
|
+
"fastly-client-ip",
|
|
15
|
+
"x-real-ip",
|
|
16
|
+
"x-cluster-client-ip",
|
|
17
|
+
"x-forwarded",
|
|
18
|
+
"forwarded-for",
|
|
19
|
+
"forwarded"
|
|
20
20
|
];
|
|
21
21
|
for (const key of keys){
|
|
22
22
|
const value = headers.get(key);
|
|
23
|
-
if (typeof value ===
|
|
24
|
-
const ip = value.split(
|
|
23
|
+
if (typeof value === "string") {
|
|
24
|
+
const ip = value.split(",")[0]?.trim();
|
|
25
25
|
if (ip) return ip;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
return null;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZXQtaXAudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gXCJiZXR0ZXItYXV0aFwiO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2V0SXAoXG4gIGhlYWRlcnM6IEhlYWRlcnMsXG4gIG9wdGlvbnM6IEJldHRlckF1dGhPcHRpb25zXG4pOiBzdHJpbmcgfCBudWxsIHtcbiAgaWYgKG9wdGlvbnMuYWR2YW5jZWQ/LmlwQWRkcmVzcz8uZGlzYWJsZUlwVHJhY2tpbmcpIHtcbiAgICByZXR1cm4gbnVsbDtcbiAgfVxuICBjb25zdCB0ZXN0SVAgPSBcIjEyNy4wLjAuMVwiO1xuICBpZiAoXG4gICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSBcInRlc3RcIiB8fFxuICAgICAgcHJvY2Vzcy5lbnYuTk9ERV9FTlYgPT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VNBLE1BQ2RDLE9BQWdCLEVBQ2hCQyxPQUEwQjtJQUUxQixJQUFJQSxRQUFRQyxRQUFRLEVBQUVDLFdBQVdDLG1CQUFtQjtRQUNsRCxPQUFPO0lBQ1Q7SUFDQSxNQUFNQyxTQUFTO0lBQ2YsSUFDRSxBQUFDQyxDQUFBQSxRQUFRQyxHQUFHLENBQUNDLFFBQVEsS0FBSyxVQUN4QkYsUUFBUUMsR0FBRyxDQUFDQyxRQUFRLEtBQUssYUFBWSxLQUN2QyxPQUNBO1FBQ0EsT0FBT0g7SUFDVDtJQUNBLE1BQU1JLFlBQVlSLFFBQVFDLFFBQVEsRUFBRUMsV0FBV087SUFDL0MsTUFBTUMsT0FBT0YsYUFBYTtRQUN4QjtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7UUFDQTtRQUNBO1FBQ0E7S0FDRDtJQUNELEtBQUssTUFBTUcsT0FBT0QsS0FBTTtRQUN0QixNQUFNRSxRQUFRYixRQUFRYyxHQUFHLENBQUNGO1FBQzFCLElBQUksT0FBT0MsVUFBVSxVQUFVO1lBQzdCLE1BQU1FLEtBQUtGLE1BQU1HLEtBQUssQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFQztZQUNoQyxJQUFJRixJQUFJLE9BQU9BO1FBQ2pCO0lBQ0Y7SUFDQSxPQUFPO0FBQ1QifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-requst-collection.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/get-requst-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzE,eAAO,MAAM,oBAAoB,GAAI,KAAK,cAAc,KAAG,UAiB1D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APIError } from "payload";
|
|
2
|
+
export const getRequestCollection = (req)=>{
|
|
3
|
+
const collectionSlug = req.routeParams?.collection;
|
|
4
|
+
if (typeof collectionSlug !== "string") {
|
|
5
|
+
throw new APIError(`No collection was specified`, 400);
|
|
6
|
+
}
|
|
7
|
+
const collection = req.payload.collections[collectionSlug];
|
|
8
|
+
if (!collection) {
|
|
9
|
+
throw new APIError(`Collection with the slug ${collectionSlug} was not found`, 404);
|
|
10
|
+
}
|
|
11
|
+
return collection;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9nZXQtcmVxdXN0LWNvbGxlY3Rpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJRXJyb3IsIHR5cGUgQ29sbGVjdGlvbiwgdHlwZSBQYXlsb2FkUmVxdWVzdCB9IGZyb20gXCJwYXlsb2FkXCI7XG5cbmV4cG9ydCBjb25zdCBnZXRSZXF1ZXN0Q29sbGVjdGlvbiA9IChyZXE6IFBheWxvYWRSZXF1ZXN0KTogQ29sbGVjdGlvbiA9PiB7XG4gIGNvbnN0IGNvbGxlY3Rpb25TbHVnID0gcmVxLnJvdXRlUGFyYW1zPy5jb2xsZWN0aW9uO1xuXG4gIGlmICh0eXBlb2YgY29sbGVjdGlvblNsdWcgIT09IFwic3RyaW5nXCIpIHtcbiAgICB0aHJvdyBuZXcgQVBJRXJyb3IoYE5vIGNvbGxlY3Rpb24gd2FzIHNwZWNpZmllZGAsIDQwMCk7XG4gIH1cblxuICBjb25zdCBjb2xsZWN0aW9uID0gcmVxLnBheWxvYWQuY29sbGVjdGlvbnNbY29sbGVjdGlvblNsdWddO1xuXG4gIGlmICghY29sbGVjdGlvbikge1xuICAgIHRocm93IG5ldyBBUElFcnJvcihcbiAgICAgIGBDb2xsZWN0aW9uIHdpdGggdGhlIHNsdWcgJHtjb2xsZWN0aW9uU2x1Z30gd2FzIG5vdCBmb3VuZGAsXG4gICAgICA0MDRcbiAgICApO1xuICB9XG5cbiAgcmV0dXJuIGNvbGxlY3Rpb247XG59O1xuIl0sIm5hbWVzIjpbIkFQSUVycm9yIiwiZ2V0UmVxdWVzdENvbGxlY3Rpb24iLCJyZXEiLCJjb2xsZWN0aW9uU2x1ZyIsInJvdXRlUGFyYW1zIiwiY29sbGVjdGlvbiIsInBheWxvYWQiLCJjb2xsZWN0aW9ucyJdLCJtYXBwaW5ncyI6IkFBQUEsU0FBU0EsUUFBUSxRQUE4QyxVQUFVO0FBRXpFLE9BQU8sTUFBTUMsdUJBQXVCLENBQUNDO0lBQ25DLE1BQU1DLGlCQUFpQkQsSUFBSUUsV0FBVyxFQUFFQztJQUV4QyxJQUFJLE9BQU9GLG1CQUFtQixVQUFVO1FBQ3RDLE1BQU0sSUFBSUgsU0FBUyxDQUFDLDJCQUEyQixDQUFDLEVBQUU7SUFDcEQ7SUFFQSxNQUFNSyxhQUFhSCxJQUFJSSxPQUFPLENBQUNDLFdBQVcsQ0FBQ0osZUFBZTtJQUUxRCxJQUFJLENBQUNFLFlBQVk7UUFDZixNQUFNLElBQUlMLFNBQ1IsQ0FBQyx5QkFBeUIsRUFBRUcsZUFBZSxjQUFjLENBQUMsRUFDMUQ7SUFFSjtJQUVBLE9BQU9FO0FBQ1QsRUFBRSJ9
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { generateVerifyEmailUrl } from
|
|
1
|
+
export { generateVerifyEmailUrl } from "./generate-verify-email-url";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { generateVerifyEmailUrl } from
|
|
1
|
+
export { generateVerifyEmailUrl } from "./generate-verify-email-url";
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBnZW5lcmF0ZVZlcmlmeUVtYWlsVXJsIH0gZnJvbSBcIi4vZ2VuZXJhdGUtdmVyaWZ5LWVtYWlsLXVybFwiO1xuIl0sIm5hbWVzIjpbImdlbmVyYXRlVmVyaWZ5RW1haWxVcmwiXSwibWFwcGluZ3MiOiJBQUFBLFNBQVNBLHNCQUFzQixRQUFRLDhCQUE4QiJ9
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config, Payload } from
|
|
1
|
+
import type { Config, Payload } from "payload";
|
|
2
2
|
type CollectionSlugs = {
|
|
3
3
|
userCollectionSlug: string;
|
|
4
4
|
sessionCollectionSlug: string;
|
|
@@ -12,10 +12,11 @@ export declare function prepareSessionData({ newSession, payloadConfig, collecti
|
|
|
12
12
|
user: any;
|
|
13
13
|
session: any;
|
|
14
14
|
};
|
|
15
|
-
payloadConfig: Payload[
|
|
15
|
+
payloadConfig: Payload["config"] | Config;
|
|
16
16
|
collectionSlugs: CollectionSlugs;
|
|
17
17
|
}): Promise<{
|
|
18
18
|
user: Record<string, unknown>;
|
|
19
19
|
session: any;
|
|
20
20
|
} | null>;
|
|
21
21
|
export {};
|
|
22
|
+
//# sourceMappingURL=prepare-session-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-session-data.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/prepare-session-data.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE/C,KAAK,eAAe,GAAG;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,UAAU,EACV,aAAa,EACb,eAAe,GAChB,EAAE;IACD,UAAU,EAAE;QACV,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,GAAG,CAAC;KACd,CAAC;IACF,aAAa,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IAC1C,eAAe,EAAE,eAAe,CAAC;CAClC;;;UAiDA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getFieldsToSign } from "payload";
|
|
2
|
+
/**
|
|
3
|
+
* Prepares session data for cookie cache by filtering user and session objects
|
|
4
|
+
* based on the payload configuration's 'saveToJwt' property
|
|
5
|
+
*/ export async function prepareSessionData({ newSession, payloadConfig, collectionSlugs }) {
|
|
6
|
+
if (!newSession || !newSession.user) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const { userCollectionSlug, sessionCollectionSlug } = collectionSlugs;
|
|
10
|
+
const userCollection = payloadConfig?.collections?.find((c)=>c.slug === userCollectionSlug);
|
|
11
|
+
const sessionCollection = payloadConfig?.collections?.find((c)=>c.slug === sessionCollectionSlug);
|
|
12
|
+
if (!userCollection) {
|
|
13
|
+
throw new Error(`User collection with slug '${userCollectionSlug}' not found`);
|
|
14
|
+
}
|
|
15
|
+
const filteredUser = getFieldsToSign({
|
|
16
|
+
collectionConfig: userCollection,
|
|
17
|
+
email: newSession.user.email,
|
|
18
|
+
user: newSession.user
|
|
19
|
+
});
|
|
20
|
+
let filteredSession = newSession.session;
|
|
21
|
+
const isImpersonated = newSession.session.impersonatedBy;
|
|
22
|
+
if (sessionCollection && newSession.session) {
|
|
23
|
+
filteredSession = getFieldsToSign({
|
|
24
|
+
collectionConfig: sessionCollection,
|
|
25
|
+
email: newSession.user.email,
|
|
26
|
+
user: newSession.session
|
|
27
|
+
});
|
|
28
|
+
// getFieldsToSign is meant for auth collections so we remove the email and collection fields
|
|
29
|
+
delete filteredSession.email;
|
|
30
|
+
delete filteredSession.collection;
|
|
31
|
+
}
|
|
32
|
+
if (isImpersonated) {
|
|
33
|
+
filteredSession.impersonatedBy = newSession.session.impersonatedBy;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
...newSession,
|
|
37
|
+
user: filteredUser,
|
|
38
|
+
session: filteredSession
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9wcmVwYXJlLXNlc3Npb24tZGF0YS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBnZXRGaWVsZHNUb1NpZ24gfSBmcm9tIFwicGF5bG9hZFwiO1xuaW1wb3J0IHR5cGUgeyBDb25maWcsIFBheWxvYWQgfSBmcm9tIFwicGF5bG9hZFwiO1xuXG50eXBlIENvbGxlY3Rpb25TbHVncyA9IHtcbiAgdXNlckNvbGxlY3Rpb25TbHVnOiBzdHJpbmc7XG4gIHNlc3Npb25Db2xsZWN0aW9uU2x1Zzogc3RyaW5nO1xufTtcblxuLyoqXG4gKiBQcmVwYXJlcyBzZXNzaW9uIGRhdGEgZm9yIGNvb2tpZSBjYWNoZSBieSBmaWx0ZXJpbmcgdXNlciBhbmQgc2Vzc2lvbiBvYmplY3RzXG4gKiBiYXNlZCBvbiB0aGUgcGF5bG9hZCBjb25maWd1cmF0aW9uJ3MgJ3NhdmVUb0p3dCcgcHJvcGVydHlcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHByZXBhcmVTZXNzaW9uRGF0YSh7XG4gIG5ld1Nlc3Npb24sXG4gIHBheWxvYWRDb25maWcsXG4gIGNvbGxlY3Rpb25TbHVncyxcbn06IHtcbiA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UUFDNUJaLE1BQU1ILFdBQVdHLElBQUk7SUFDdkI7SUFFQSxJQUFJYSxrQkFBa0JoQixXQUFXaUIsT0FBTztJQUN4QyxNQUFNQyxpQkFBaUJsQixXQUFXaUIsT0FBTyxDQUFDRSxjQUFjO0lBQ3hELElBQUlSLHFCQUFxQlgsV0FBV2lCLE9BQU8sRUFBRTtRQUMzQ0Qsa0JBQWtCbEIsZ0JBQWdCO1lBQ2hDZ0Isa0JBQWtCSDtZQUNsQkksT0FBT2YsV0FBV0csSUFBSSxDQUFDWSxLQUFLO1lBQzVCWixNQUFNSCxXQUFXaUIsT0FBTztRQUMxQjtRQUVBLDZGQUE2RjtRQUM3RixPQUFPRCxnQkFBZ0JELEtBQUs7UUFDNUIsT0FBT0MsZ0JBQWdCSSxVQUFVO0lBQ25DO0lBRUEsSUFBSUYsZ0JBQWdCO1FBQ2xCRixnQkFBZ0JHLGNBQWMsR0FBR25CLFdBQVdpQixPQUFPLENBQUNFLGNBQWM7SUFDcEU7SUFFQSxPQUFPO1FBQ0wsR0FBR25CLFVBQVU7UUFDYkcsTUFBTVU7UUFDTkksU0FBU0Q7SUFDWDtBQUNGIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type CookiePrefixOptions =
|
|
1
|
+
type CookiePrefixOptions = "host" | "secure";
|
|
2
2
|
type CookieOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* Domain of the cookie
|
|
@@ -67,7 +67,7 @@ type CookieOptions = {
|
|
|
67
67
|
* None - Means that the browser sends the cookie with both cross-site and same-site requests.
|
|
68
68
|
* The Secure attribute must also be set when setting this value.
|
|
69
69
|
*/
|
|
70
|
-
sameSite?:
|
|
70
|
+
sameSite?: "Strict" | "Lax" | "None" | "strict" | "lax" | "none";
|
|
71
71
|
/**
|
|
72
72
|
* Indicates that the cookie should be stored using partitioned storage. Note that if this is
|
|
73
73
|
* set, the Secure directive must also be set.
|
|
@@ -102,3 +102,4 @@ export declare function tryDecode(str: string): string;
|
|
|
102
102
|
export declare function parseCookies(str: string): Map<string, string>;
|
|
103
103
|
export declare const getSignedCookie: (key: string, secret: string, headers: Headers, prefix?: CookiePrefixOptions) => Promise<string | false | null>;
|
|
104
104
|
export {};
|
|
105
|
+
//# sourceMappingURL=serialize-cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-cookie.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/serialize-cookie.ts"],"names":[],"mappings":"AAEA,KAAK,mBAAmB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE7C,KAAK,aAAa,GAAG;IACnB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACjE;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,iBAAiB,MAAM,EACvB,OAAO,MAAM,EACb,QAAQ,SAAS,KAChB,OAAO,CAAC,OAAO,CAgBjB,CAAC;AAwGF,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EACb,QAAQ,MAAM,GAAG,YAAY,oBAO9B,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,KAAK,MAAM,EACX,OAAO,MAAM,EACb,MA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