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,181 +0,0 @@
|
|
|
1
|
-
import { betterAuth } from 'better-auth';
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it, test } from 'vitest';
|
|
3
|
-
import { payloadAdapter } from 'payload-auth/better-auth/adapter';
|
|
4
|
-
import { runAdapterTest } from './better-auth-adapter-test.js';
|
|
5
|
-
import { getPayload } from '../dev/index.js';
|
|
6
|
-
describe('Handle Payload Adapter', async ()=>{
|
|
7
|
-
it('should successfully add the Payload Adapter', async ()=>{
|
|
8
|
-
const payload = await getPayload();
|
|
9
|
-
const auth = betterAuth({
|
|
10
|
-
database: payloadAdapter(payload)
|
|
11
|
-
});
|
|
12
|
-
expect(auth).toBeDefined();
|
|
13
|
-
expect(auth.options.database).toBeDefined();
|
|
14
|
-
expect(auth.options.database({}).id).toEqual('payload');
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
function deleteAll(payload) {
|
|
18
|
-
beforeAll(async ()=>{
|
|
19
|
-
// delete all users and sessions
|
|
20
|
-
const res = await payload.delete({
|
|
21
|
-
collection: 'user',
|
|
22
|
-
where: {
|
|
23
|
-
id: {
|
|
24
|
-
exists: true
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
console.log('before users: ', res.docs.length, res.errors);
|
|
29
|
-
const res2 = await payload.delete({
|
|
30
|
-
collection: 'session',
|
|
31
|
-
where: {
|
|
32
|
-
id: {
|
|
33
|
-
exists: true
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
console.log('before sessions: ', res2.docs.length, res2.errors);
|
|
38
|
-
const res3 = await payload.delete({
|
|
39
|
-
collection: 'account',
|
|
40
|
-
where: {
|
|
41
|
-
id: {
|
|
42
|
-
exists: true
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
console.log('before accounts: ', res3.docs.length, res3.errors);
|
|
47
|
-
const res4 = await payload.delete({
|
|
48
|
-
collection: 'verification',
|
|
49
|
-
where: {
|
|
50
|
-
id: {
|
|
51
|
-
exists: true
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
console.log('before verification: ', res4.docs.length, res4.errors);
|
|
56
|
-
});
|
|
57
|
-
afterAll(async ()=>{
|
|
58
|
-
const res2 = await payload.delete({
|
|
59
|
-
collection: 'session',
|
|
60
|
-
where: {
|
|
61
|
-
id: {
|
|
62
|
-
exists: true
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
console.log('after sessions: ', res2.docs.length, res2.errors);
|
|
67
|
-
const res3 = await payload.delete({
|
|
68
|
-
collection: 'account',
|
|
69
|
-
where: {
|
|
70
|
-
id: {
|
|
71
|
-
exists: true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
console.log('after accounts: ', res3.docs.length, res3.errors);
|
|
76
|
-
const res = await payload.delete({
|
|
77
|
-
collection: 'user',
|
|
78
|
-
where: {
|
|
79
|
-
id: {
|
|
80
|
-
exists: true
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
console.log('after users: ', res.docs.length, res.errors);
|
|
85
|
-
const res4 = await payload.delete({
|
|
86
|
-
collection: 'verification',
|
|
87
|
-
where: {
|
|
88
|
-
id: {
|
|
89
|
-
exists: true
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
console.log('after verification: ', res4.docs.length, res4.errors);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
describe('Run BetterAuth Adapter tests', async ()=>{
|
|
97
|
-
const payload = await getPayload();
|
|
98
|
-
deleteAll(payload);
|
|
99
|
-
const adapter = payloadAdapter(payload, {
|
|
100
|
-
enableDebugLogs: true
|
|
101
|
-
});
|
|
102
|
-
await runAdapterTest({
|
|
103
|
-
getAdapter: async (customOptions = {
|
|
104
|
-
session: {
|
|
105
|
-
fields: {
|
|
106
|
-
userId: 'user'
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
account: {
|
|
110
|
-
fields: {
|
|
111
|
-
userId: 'user'
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
})=>{
|
|
115
|
-
return adapter({
|
|
116
|
-
...customOptions
|
|
117
|
-
});
|
|
118
|
-
},
|
|
119
|
-
skipGenerateIdTest: true
|
|
120
|
-
});
|
|
121
|
-
test('should find many with offset and limit', async ()=>{
|
|
122
|
-
// At this point, `user` contains 8 rows.
|
|
123
|
-
// offset of 2 returns 6 rows
|
|
124
|
-
// limit of 2 returns 2 rows
|
|
125
|
-
const res = await adapter({}).findMany({
|
|
126
|
-
model: 'user',
|
|
127
|
-
offset: 2,
|
|
128
|
-
limit: 2
|
|
129
|
-
});
|
|
130
|
-
expect(res.length).toBe(2);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
describe('Authentication Flow Tests', async ()=>{
|
|
134
|
-
const testUser = {
|
|
135
|
-
email: 'test-email@email.com',
|
|
136
|
-
password: 'password12345',
|
|
137
|
-
name: 'Test Name'
|
|
138
|
-
};
|
|
139
|
-
const payload = await getPayload();
|
|
140
|
-
deleteAll(payload);
|
|
141
|
-
const auth = betterAuth({
|
|
142
|
-
database: payloadAdapter(payload, {
|
|
143
|
-
enableDebugLogs: true
|
|
144
|
-
}),
|
|
145
|
-
emailAndPassword: {
|
|
146
|
-
enabled: true
|
|
147
|
-
},
|
|
148
|
-
session: {
|
|
149
|
-
fields: {
|
|
150
|
-
userId: 'user'
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
account: {
|
|
154
|
-
fields: {
|
|
155
|
-
userId: 'user'
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
it('should successfully sign up a new user', async ()=>{
|
|
160
|
-
const user = await auth.api.signUpEmail({
|
|
161
|
-
body: {
|
|
162
|
-
email: testUser.email,
|
|
163
|
-
password: testUser.password,
|
|
164
|
-
name: testUser.name
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
expect(user).toBeDefined();
|
|
168
|
-
});
|
|
169
|
-
it('should successfully sign in an existing user', async ()=>{
|
|
170
|
-
await new Promise((resolve)=>setTimeout(resolve, 2000));
|
|
171
|
-
const user = await auth.api.signInEmail({
|
|
172
|
-
body: {
|
|
173
|
-
email: testUser.email,
|
|
174
|
-
password: testUser.password
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
expect(user.user).toBeDefined();
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
//# sourceMappingURL=adapter.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/test/adapter.test.ts"],"sourcesContent":["import { betterAuth, type BetterAuthOptions } from 'better-auth'\nimport { afterAll, beforeAll, describe, expect, it, test } from 'vitest'\nimport { payloadAdapter } from 'payload-auth/better-auth/adapter'\nimport { runAdapterTest } from './better-auth-adapter-test.js'\nimport { getPayload } from '../dev/index.js'\nimport { BasePayload } from 'payload'\n\ndescribe('Handle Payload Adapter', async () => {\n it('should successfully add the Payload Adapter', async () => {\n const payload = await getPayload()\n\n const auth = betterAuth({\n database: payloadAdapter(payload),\n })\n\n expect(auth).toBeDefined()\n expect(auth.options.database).toBeDefined()\n expect(auth.options.database({}).id).toEqual('payload')\n })\n})\n\nfunction deleteAll(payload: BasePayload) {\n beforeAll(async () => {\n // delete all users and sessions\n const res = await payload.delete({\n collection: 'user',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('before users: ', res.docs.length, res.errors)\n const res2 = await payload.delete({\n collection: 'session',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('before sessions: ', res2.docs.length, res2.errors)\n const res3 = await payload.delete({\n collection: 'account',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('before accounts: ', res3.docs.length, res3.errors)\n const res4 = await payload.delete({\n collection: 'verification',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('before verification: ', res4.docs.length, res4.errors)\n })\n afterAll(async () => {\n const res2 = await payload.delete({\n collection: 'session',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('after sessions: ', res2.docs.length, res2.errors)\n const res3 = await payload.delete({\n collection: 'account',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('after accounts: ', res3.docs.length, res3.errors)\n const res = await payload.delete({\n collection: 'user',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('after users: ', res.docs.length, res.errors)\n\n const res4 = await payload.delete({\n collection: 'verification',\n where: {\n id: {\n exists: true,\n },\n },\n })\n console.log('after verification: ', res4.docs.length, res4.errors)\n })\n}\n\ndescribe('Run BetterAuth Adapter tests', async () => {\n const payload = await getPayload()\n\n deleteAll(payload)\n\n const adapter = payloadAdapter(payload, {\n enableDebugLogs: true,\n })\n\n await runAdapterTest({\n getAdapter: async (\n customOptions = {\n session: {\n fields: {\n userId: 'user',\n },\n },\n account: {\n fields: {\n userId: 'user',\n },\n },\n },\n ) => {\n return adapter({ ...customOptions })\n },\n skipGenerateIdTest: true,\n })\n test('should find many with offset and limit', async () => {\n // At this point, `user` contains 8 rows.\n // offset of 2 returns 6 rows\n // limit of 2 returns 2 rows\n const res = await adapter({}).findMany({\n model: 'user',\n offset: 2,\n limit: 2,\n })\n expect(res.length).toBe(2)\n })\n})\n\ndescribe('Authentication Flow Tests', async () => {\n const testUser = {\n email: 'test-email@email.com',\n password: 'password12345',\n name: 'Test Name',\n }\n const payload = await getPayload()\n\n deleteAll(payload)\n\n const auth = betterAuth({\n database: payloadAdapter(payload, {\n enableDebugLogs: true,\n }),\n emailAndPassword: {\n enabled: true,\n },\n session: {\n fields: {\n userId: 'user',\n },\n },\n account: {\n fields: {\n userId: 'user',\n },\n },\n })\n\n it('should successfully sign up a new user', async () => {\n const user = await auth.api.signUpEmail({\n body: {\n email: testUser.email,\n password: testUser.password,\n name: testUser.name,\n },\n })\n expect(user).toBeDefined()\n })\n\n it('should successfully sign in an existing user', async () => {\n await new Promise((resolve) => setTimeout(resolve, 2000))\n const user = await auth.api.signInEmail({\n body: {\n email: testUser.email,\n password: testUser.password,\n },\n })\n\n expect(user.user).toBeDefined()\n })\n})\n"],"names":["betterAuth","afterAll","beforeAll","describe","expect","it","test","payloadAdapter","runAdapterTest","getPayload","payload","auth","database","toBeDefined","options","id","toEqual","deleteAll","res","delete","collection","where","exists","console","log","docs","length","errors","res2","res3","res4","adapter","enableDebugLogs","getAdapter","customOptions","session","fields","userId","account","skipGenerateIdTest","findMany","model","offset","limit","toBe","testUser","email","password","name","emailAndPassword","enabled","user","api","signUpEmail","body","Promise","resolve","setTimeout","signInEmail"],"mappings":"AAAA,SAASA,UAAU,QAAgC,cAAa;AAChE,SAASC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,IAAI,QAAQ,SAAQ;AACxE,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,UAAU,QAAQ,kBAAiB;AAG5CN,SAAS,0BAA0B;IACjCE,GAAG,+CAA+C;QAChD,MAAMK,UAAU,MAAMD;QAEtB,MAAME,OAAOX,WAAW;YACtBY,UAAUL,eAAeG;QAC3B;QAEAN,OAAOO,MAAME,WAAW;QACxBT,OAAOO,KAAKG,OAAO,CAACF,QAAQ,EAAEC,WAAW;QACzCT,OAAOO,KAAKG,OAAO,CAACF,QAAQ,CAA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AUL,eAAeG,SAAS;YAChCsB,iBAAiB;QACnB;QACAiB,kBAAkB;YAChBC,SAAS;QACX;QACAf,SAAS;YACPC,QAAQ;gBACNC,QAAQ;YACV;QACF;QACAC,SAAS;YACPF,QAAQ;gBACNC,QAAQ;YACV;QACF;IACF;IAEAhC,GAAG,0CAA0C;QAC3C,MAAM8C,OAAO,MAAMxC,KAAKyC,GAAG,CAACC,WAAW,CAAC;YACtCC,MAAM;gBACJR,OAAOD,SAASC,KAAK;gBACrBC,UAAUF,SAASE,QAAQ;gBAC3BC,MAAMH,SAASG,IAAI;YACrB;QACF;QACA5C,OAAO+C,MAAMtC,WAAW;IAC1B;IAEAR,GAAG,gDAAgD;QACjD,MAAM,IAAIkD,QAAQ,CAACC,UAAYC,WAAWD,SAAS;QACnD,MAAML,OAAO,MAAMxC,KAAKyC,GAAG,CAACM,WAAW,CAAC;YACtCJ,MAAM;gBACJR,OAAOD,SAASC,KAAK;gBACrBC,UAAUF,SAASE,QAAQ;YAC7B;QACF;QAEA3C,OAAO+C,KAAKA,IAAI,EAAEtC,WAAW;IAC/B;AACF"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Adapter, BetterAuthOptions } from 'better-auth';
|
|
2
|
-
interface AdapterTestOptions {
|
|
3
|
-
getAdapter: (customOptions?: Omit<BetterAuthOptions, 'database'>) => Promise<Adapter>;
|
|
4
|
-
skipGenerateIdTest?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function runAdapterTest(opts: AdapterTestOptions): Promise<void>;
|
|
7
|
-
export {};
|
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import { expect, test } from 'vitest';
|
|
2
|
-
import { generateId } from 'better-auth';
|
|
3
|
-
export async function runAdapterTest(opts) {
|
|
4
|
-
const adapter = await opts.getAdapter();
|
|
5
|
-
const user = {
|
|
6
|
-
id: '1',
|
|
7
|
-
name: 'user',
|
|
8
|
-
email: 'user@email.com',
|
|
9
|
-
emailVerified: true,
|
|
10
|
-
createdAt: new Date(),
|
|
11
|
-
updatedAt: new Date()
|
|
12
|
-
};
|
|
13
|
-
test('create model', async ()=>{
|
|
14
|
-
const res = await adapter.create({
|
|
15
|
-
model: 'user',
|
|
16
|
-
data: user
|
|
17
|
-
});
|
|
18
|
-
expect({
|
|
19
|
-
name: res.name,
|
|
20
|
-
email: res.email
|
|
21
|
-
}).toEqual({
|
|
22
|
-
name: user.name,
|
|
23
|
-
email: user.email
|
|
24
|
-
});
|
|
25
|
-
user.id = res.id;
|
|
26
|
-
});
|
|
27
|
-
test('find model', async ()=>{
|
|
28
|
-
const res = await adapter.findOne({
|
|
29
|
-
model: 'user',
|
|
30
|
-
where: [
|
|
31
|
-
{
|
|
32
|
-
field: 'id',
|
|
33
|
-
value: user.id
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
expect({
|
|
38
|
-
name: res?.name,
|
|
39
|
-
email: res?.email
|
|
40
|
-
}).toEqual({
|
|
41
|
-
name: user.name,
|
|
42
|
-
email: user.email
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
test('find model without id', async ()=>{
|
|
46
|
-
const res = await adapter.findOne({
|
|
47
|
-
model: 'user',
|
|
48
|
-
where: [
|
|
49
|
-
{
|
|
50
|
-
field: 'email',
|
|
51
|
-
value: user.email
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
expect({
|
|
56
|
-
name: res?.name,
|
|
57
|
-
email: res?.email
|
|
58
|
-
}).toEqual({
|
|
59
|
-
name: user.name,
|
|
60
|
-
email: user.email
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
test('find model with select', async ()=>{
|
|
64
|
-
const res = await adapter.findOne({
|
|
65
|
-
model: 'user',
|
|
66
|
-
where: [
|
|
67
|
-
{
|
|
68
|
-
field: 'id',
|
|
69
|
-
value: user.id
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
select: [
|
|
73
|
-
'email'
|
|
74
|
-
]
|
|
75
|
-
});
|
|
76
|
-
expect(res).toEqual({
|
|
77
|
-
id: user.id,
|
|
78
|
-
email: user.email
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
test('update model', async ()=>{
|
|
82
|
-
const newEmail = 'updated@email.com';
|
|
83
|
-
const res = await adapter.update({
|
|
84
|
-
model: 'user',
|
|
85
|
-
where: [
|
|
86
|
-
{
|
|
87
|
-
field: 'id',
|
|
88
|
-
value: user.id
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
update: {
|
|
92
|
-
email: newEmail
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
expect(res).toMatchObject({
|
|
96
|
-
email: newEmail,
|
|
97
|
-
name: user.name
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
test('should find many', async ()=>{
|
|
101
|
-
const res = await adapter.findMany({
|
|
102
|
-
model: 'user'
|
|
103
|
-
});
|
|
104
|
-
expect(res.length).toBe(1);
|
|
105
|
-
});
|
|
106
|
-
test('should find many with where', async ()=>{
|
|
107
|
-
const user = await adapter.create({
|
|
108
|
-
model: 'user',
|
|
109
|
-
data: {
|
|
110
|
-
id: '2',
|
|
111
|
-
name: 'user2',
|
|
112
|
-
email: 'test@email.com',
|
|
113
|
-
emailVerified: true,
|
|
114
|
-
createdAt: new Date(),
|
|
115
|
-
updatedAt: new Date()
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
const res = await adapter.findMany({
|
|
119
|
-
model: 'user',
|
|
120
|
-
where: [
|
|
121
|
-
{
|
|
122
|
-
field: 'id',
|
|
123
|
-
value: user.id
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
});
|
|
127
|
-
expect(res.length).toBe(1);
|
|
128
|
-
});
|
|
129
|
-
test('should find many with operators', async ()=>{
|
|
130
|
-
const newUser = await adapter.create({
|
|
131
|
-
model: 'user',
|
|
132
|
-
data: {
|
|
133
|
-
id: '3',
|
|
134
|
-
name: 'user',
|
|
135
|
-
email: 'test-email2@email.com',
|
|
136
|
-
emailVerified: true,
|
|
137
|
-
createdAt: new Date(),
|
|
138
|
-
updatedAt: new Date()
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
const res = await adapter.findMany({
|
|
142
|
-
model: 'user',
|
|
143
|
-
where: [
|
|
144
|
-
{
|
|
145
|
-
field: 'id',
|
|
146
|
-
operator: 'in',
|
|
147
|
-
value: [
|
|
148
|
-
user.id,
|
|
149
|
-
newUser.id
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
]
|
|
153
|
-
});
|
|
154
|
-
expect(res.length).toBe(2);
|
|
155
|
-
});
|
|
156
|
-
test('should work with reference fields', async ()=>{
|
|
157
|
-
let token = null;
|
|
158
|
-
const user = await adapter.create({
|
|
159
|
-
model: 'user',
|
|
160
|
-
data: {
|
|
161
|
-
id: '4',
|
|
162
|
-
name: 'user',
|
|
163
|
-
email: 'my-email@email.com',
|
|
164
|
-
emailVerified: true,
|
|
165
|
-
createdAt: new Date(),
|
|
166
|
-
updatedAt: new Date()
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
const session = await adapter.create({
|
|
170
|
-
model: 'session',
|
|
171
|
-
data: {
|
|
172
|
-
id: '1',
|
|
173
|
-
token: generateId(),
|
|
174
|
-
createdAt: new Date(),
|
|
175
|
-
updatedAt: new Date(),
|
|
176
|
-
userId: user.id,
|
|
177
|
-
expiresAt: new Date()
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
token = session.token;
|
|
181
|
-
const res = await adapter.findOne({
|
|
182
|
-
model: 'session',
|
|
183
|
-
where: [
|
|
184
|
-
{
|
|
185
|
-
field: 'userId',
|
|
186
|
-
value: user.id
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
});
|
|
190
|
-
const resToken = await adapter.findOne({
|
|
191
|
-
model: 'session',
|
|
192
|
-
where: [
|
|
193
|
-
{
|
|
194
|
-
field: 'token',
|
|
195
|
-
value: token
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
});
|
|
199
|
-
expect(res).toMatchObject({
|
|
200
|
-
userId: user.id
|
|
201
|
-
});
|
|
202
|
-
expect(resToken).toMatchObject({
|
|
203
|
-
userId: user.id
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
test('should find many with sortBy', async ()=>{
|
|
207
|
-
await adapter.create({
|
|
208
|
-
model: 'user',
|
|
209
|
-
data: {
|
|
210
|
-
id: '5',
|
|
211
|
-
name: 'a',
|
|
212
|
-
email: 'a@email.com',
|
|
213
|
-
emailVerified: true,
|
|
214
|
-
createdAt: new Date(),
|
|
215
|
-
updatedAt: new Date()
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
const res = await adapter.findMany({
|
|
219
|
-
model: 'user',
|
|
220
|
-
sortBy: {
|
|
221
|
-
field: 'name',
|
|
222
|
-
direction: 'asc'
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
expect(res[0].name).toBe('a');
|
|
226
|
-
const res2 = await adapter.findMany({
|
|
227
|
-
model: 'user',
|
|
228
|
-
sortBy: {
|
|
229
|
-
field: 'name',
|
|
230
|
-
direction: 'desc'
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
expect(res2[res2.length - 1].name).toBe('a');
|
|
234
|
-
});
|
|
235
|
-
test('should find many with limit', async ()=>{
|
|
236
|
-
const res = await adapter.findMany({
|
|
237
|
-
model: 'user',
|
|
238
|
-
limit: 1
|
|
239
|
-
});
|
|
240
|
-
expect(res.length).toBe(1);
|
|
241
|
-
});
|
|
242
|
-
test('should update with multiple where', async ()=>{
|
|
243
|
-
await adapter.updateMany({
|
|
244
|
-
model: 'user',
|
|
245
|
-
where: [
|
|
246
|
-
{
|
|
247
|
-
field: 'name',
|
|
248
|
-
value: user.name
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
field: 'email',
|
|
252
|
-
value: user.email
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
update: {
|
|
256
|
-
email: 'updated@email.com'
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
const updatedUser = await adapter.findOne({
|
|
260
|
-
model: 'user',
|
|
261
|
-
where: [
|
|
262
|
-
{
|
|
263
|
-
field: 'email',
|
|
264
|
-
value: 'updated@email.com'
|
|
265
|
-
}
|
|
266
|
-
]
|
|
267
|
-
});
|
|
268
|
-
expect(updatedUser).toMatchObject({
|
|
269
|
-
name: user.name,
|
|
270
|
-
email: 'updated@email.com'
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
test('delete model', async ()=>{
|
|
274
|
-
await adapter.delete({
|
|
275
|
-
model: 'user',
|
|
276
|
-
where: [
|
|
277
|
-
{
|
|
278
|
-
field: 'id',
|
|
279
|
-
value: user.id
|
|
280
|
-
}
|
|
281
|
-
]
|
|
282
|
-
});
|
|
283
|
-
const findRes = await adapter.findOne({
|
|
284
|
-
model: 'user',
|
|
285
|
-
where: [
|
|
286
|
-
{
|
|
287
|
-
field: 'id',
|
|
288
|
-
value: user.id
|
|
289
|
-
}
|
|
290
|
-
]
|
|
291
|
-
});
|
|
292
|
-
expect(findRes).toBeNull();
|
|
293
|
-
});
|
|
294
|
-
test('should delete many', async ()=>{
|
|
295
|
-
for (const id of [
|
|
296
|
-
'to-be-delete1',
|
|
297
|
-
'to-be-delete2',
|
|
298
|
-
'to-be-delete3'
|
|
299
|
-
]){
|
|
300
|
-
await adapter.create({
|
|
301
|
-
model: 'user',
|
|
302
|
-
data: {
|
|
303
|
-
id,
|
|
304
|
-
name: 'to-be-deleted',
|
|
305
|
-
email: `email@test-${id}.com`,
|
|
306
|
-
emailVerified: true,
|
|
307
|
-
createdAt: new Date(),
|
|
308
|
-
updatedAt: new Date()
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
const findResFirst = await adapter.findMany({
|
|
313
|
-
model: 'user',
|
|
314
|
-
where: [
|
|
315
|
-
{
|
|
316
|
-
field: 'name',
|
|
317
|
-
value: 'to-be-deleted'
|
|
318
|
-
}
|
|
319
|
-
]
|
|
320
|
-
});
|
|
321
|
-
expect(findResFirst.length).toBe(3);
|
|
322
|
-
await adapter.deleteMany({
|
|
323
|
-
model: 'user',
|
|
324
|
-
where: [
|
|
325
|
-
{
|
|
326
|
-
field: 'name',
|
|
327
|
-
value: 'to-be-deleted'
|
|
328
|
-
}
|
|
329
|
-
]
|
|
330
|
-
});
|
|
331
|
-
const findRes = await adapter.findMany({
|
|
332
|
-
model: 'user',
|
|
333
|
-
where: [
|
|
334
|
-
{
|
|
335
|
-
field: 'name',
|
|
336
|
-
value: 'to-be-deleted'
|
|
337
|
-
}
|
|
338
|
-
]
|
|
339
|
-
});
|
|
340
|
-
expect(findRes.length).toBe(0);
|
|
341
|
-
});
|
|
342
|
-
test("shouldn't throw on delete record not found", async ()=>{
|
|
343
|
-
await adapter.delete({
|
|
344
|
-
model: 'user',
|
|
345
|
-
where: [
|
|
346
|
-
{
|
|
347
|
-
field: 'id',
|
|
348
|
-
value: '5'
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
test("shouldn't throw on record not found", async ()=>{
|
|
354
|
-
const res = await adapter.findOne({
|
|
355
|
-
model: 'user',
|
|
356
|
-
where: [
|
|
357
|
-
{
|
|
358
|
-
field: 'id',
|
|
359
|
-
value: '5'
|
|
360
|
-
}
|
|
361
|
-
]
|
|
362
|
-
});
|
|
363
|
-
expect(res).toBeNull();
|
|
364
|
-
});
|
|
365
|
-
test('should find many with contains operator', async ()=>{
|
|
366
|
-
const res = await adapter.findMany({
|
|
367
|
-
model: 'user',
|
|
368
|
-
where: [
|
|
369
|
-
{
|
|
370
|
-
field: 'name',
|
|
371
|
-
operator: 'contains',
|
|
372
|
-
value: 'user2'
|
|
373
|
-
}
|
|
374
|
-
]
|
|
375
|
-
});
|
|
376
|
-
expect(res.length).toBe(1);
|
|
377
|
-
});
|
|
378
|
-
test('should search users with startsWith', async ()=>{
|
|
379
|
-
const res = await adapter.findMany({
|
|
380
|
-
model: 'user',
|
|
381
|
-
where: [
|
|
382
|
-
{
|
|
383
|
-
field: 'name',
|
|
384
|
-
operator: 'starts_with',
|
|
385
|
-
value: 'us'
|
|
386
|
-
}
|
|
387
|
-
]
|
|
388
|
-
});
|
|
389
|
-
expect(res.length).toBe(3);
|
|
390
|
-
});
|
|
391
|
-
test('should search users with endsWith', async ()=>{
|
|
392
|
-
const res = await adapter.findMany({
|
|
393
|
-
model: 'user',
|
|
394
|
-
where: [
|
|
395
|
-
{
|
|
396
|
-
field: 'name',
|
|
397
|
-
operator: 'ends_with',
|
|
398
|
-
value: 'er2'
|
|
399
|
-
}
|
|
400
|
-
]
|
|
401
|
-
});
|
|
402
|
-
expect(res.length).toBe(1);
|
|
403
|
-
});
|
|
404
|
-
test.skipIf(opts.skipGenerateIdTest)('should prefer generateId if provided', async ()=>{
|
|
405
|
-
const customAdapter = await opts.getAdapter({
|
|
406
|
-
advanced: {
|
|
407
|
-
generateId: ()=>'mocked-id'
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
const res = await customAdapter.create({
|
|
411
|
-
model: 'user',
|
|
412
|
-
data: {
|
|
413
|
-
id: '1',
|
|
414
|
-
name: 'user4',
|
|
415
|
-
email: 'user4@email.com',
|
|
416
|
-
emailVerified: true,
|
|
417
|
-
createdAt: new Date(),
|
|
418
|
-
updatedAt: new Date()
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
expect(res.id).toBe('mocked-id');
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
//# sourceMappingURL=better-auth-adapter-test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/test/better-auth-adapter-test.ts"],"sourcesContent":["import { expect, test } from 'vitest'\nimport type { Adapter, BetterAuthOptions } from 'better-auth'\nimport { User } from 'better-auth'\nimport { generateId } from 'better-auth'\n\ninterface AdapterTestOptions {\n getAdapter: (customOptions?: Omit<BetterAuthOptions, 'database'>) => Promise<Adapter>\n skipGenerateIdTest?: boolean\n}\n\nexport async function runAdapterTest(opts: AdapterTestOptions) {\n const adapter = await opts.getAdapter()\n const user = {\n id: '1',\n name: 'user',\n email: 'user@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n }\n\n test('create model', async () => {\n const res = await adapter.create({\n model: 'user',\n data: user,\n })\n expect({\n name: res.name,\n email: res.email,\n }).toEqual({\n name: user.name,\n email: user.email,\n })\n user.id = res.id\n })\n\n test('find model', async () => {\n const res = await adapter.findOne<User>({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n })\n expect({\n name: res?.name,\n email: res?.email,\n }).toEqual({\n name: user.name,\n email: user.email,\n })\n })\n\n test('find model without id', async () => {\n const res = await adapter.findOne<User>({\n model: 'user',\n where: [\n {\n field: 'email',\n value: user.email,\n },\n ],\n })\n expect({\n name: res?.name,\n email: res?.email,\n }).toEqual({\n name: user.name,\n email: user.email,\n })\n })\n\n test('find model with select', async () => {\n const res = await adapter.findOne({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n select: ['email'],\n })\n expect(res).toEqual({ id: user.id, email: user.email })\n })\n\n test('update model', async () => {\n const newEmail = 'updated@email.com'\n\n const res = await adapter.update<User>({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n update: {\n email: newEmail,\n },\n })\n expect(res).toMatchObject({\n email: newEmail,\n name: user.name,\n })\n })\n\n test('should find many', async () => {\n const res = await adapter.findMany({\n model: 'user',\n })\n expect(res.length).toBe(1)\n })\n\n test('should find many with where', async () => {\n const user = await adapter.create<User>({\n model: 'user',\n data: {\n id: '2',\n name: 'user2',\n email: 'test@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n const res = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n })\n expect(res.length).toBe(1)\n })\n\n test('should find many with operators', async () => {\n const newUser = await adapter.create<User>({\n model: 'user',\n data: {\n id: '3',\n name: 'user',\n email: 'test-email2@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n const res = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'id',\n operator: 'in',\n value: [user.id, newUser.id],\n },\n ],\n })\n expect(res.length).toBe(2)\n })\n\n test('should work with reference fields', async () => {\n let token: string | null = null\n const user = await adapter.create<{ id: string } & Record<string, any>>({\n model: 'user',\n data: {\n id: '4',\n name: 'user',\n email: 'my-email@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n const session = await adapter.create({\n model: 'session',\n data: {\n id: '1',\n token: generateId(),\n createdAt: new Date(),\n updatedAt: new Date(),\n userId: user.id,\n expiresAt: new Date(),\n },\n })\n token = session.token\n const res = await adapter.findOne({\n model: 'session',\n where: [\n {\n field: 'userId',\n value: user.id,\n },\n ],\n })\n const resToken = await adapter.findOne({\n model: 'session',\n where: [\n {\n field: 'token',\n value: token,\n },\n ],\n })\n expect(res).toMatchObject({\n userId: user.id,\n })\n expect(resToken).toMatchObject({\n userId: user.id,\n })\n })\n\n test('should find many with sortBy', async () => {\n await adapter.create({\n model: 'user',\n data: {\n id: '5',\n name: 'a',\n email: 'a@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n const res = await adapter.findMany<User>({\n model: 'user',\n sortBy: {\n field: 'name',\n direction: 'asc',\n },\n })\n expect(res[0].name).toBe('a')\n\n const res2 = await adapter.findMany<User>({\n model: 'user',\n sortBy: {\n field: 'name',\n direction: 'desc',\n },\n })\n\n expect(res2[res2.length - 1].name).toBe('a')\n })\n\n test('should find many with limit', async () => {\n const res = await adapter.findMany({\n model: 'user',\n limit: 1,\n })\n expect(res.length).toBe(1)\n })\n\n test('should update with multiple where', async () => {\n await adapter.updateMany({\n model: 'user',\n where: [\n {\n field: 'name',\n value: user.name,\n },\n {\n field: 'email',\n value: user.email,\n },\n ],\n update: {\n email: 'updated@email.com',\n },\n })\n const updatedUser = await adapter.findOne<User>({\n model: 'user',\n where: [\n {\n field: 'email',\n value: 'updated@email.com',\n },\n ],\n })\n expect(updatedUser).toMatchObject({\n name: user.name,\n email: 'updated@email.com',\n })\n })\n\n test('delete model', async () => {\n await adapter.delete({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n })\n const findRes = await adapter.findOne({\n model: 'user',\n where: [\n {\n field: 'id',\n value: user.id,\n },\n ],\n })\n expect(findRes).toBeNull()\n })\n\n test('should delete many', async () => {\n for (const id of ['to-be-delete1', 'to-be-delete2', 'to-be-delete3']) {\n await adapter.create({\n model: 'user',\n data: {\n id,\n name: 'to-be-deleted',\n email: `email@test-${id}.com`,\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n }\n const findResFirst = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'name',\n value: 'to-be-deleted',\n },\n ],\n })\n expect(findResFirst.length).toBe(3)\n await adapter.deleteMany({\n model: 'user',\n where: [\n {\n field: 'name',\n value: 'to-be-deleted',\n },\n ],\n })\n const findRes = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'name',\n value: 'to-be-deleted',\n },\n ],\n })\n expect(findRes.length).toBe(0)\n })\n\n test(\"shouldn't throw on delete record not found\", async () => {\n await adapter.delete({\n model: 'user',\n where: [\n {\n field: 'id',\n value: '5',\n },\n ],\n })\n })\n\n test(\"shouldn't throw on record not found\", async () => {\n const res = await adapter.findOne({\n model: 'user',\n where: [\n {\n field: 'id',\n value: '5',\n },\n ],\n })\n expect(res).toBeNull()\n })\n\n test('should find many with contains operator', async () => {\n const res = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'name',\n operator: 'contains',\n value: 'user2',\n },\n ],\n })\n expect(res.length).toBe(1)\n })\n\n test('should search users with startsWith', async () => {\n const res = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'name',\n operator: 'starts_with',\n value: 'us',\n },\n ],\n })\n expect(res.length).toBe(3)\n })\n\n test('should search users with endsWith', async () => {\n const res = await adapter.findMany({\n model: 'user',\n where: [\n {\n field: 'name',\n operator: 'ends_with',\n value: 'er2',\n },\n ],\n })\n expect(res.length).toBe(1)\n })\n\n test.skipIf(opts.skipGenerateIdTest)('should prefer generateId if provided', async () => {\n const customAdapter = await opts.getAdapter({\n advanced: {\n generateId: () => 'mocked-id',\n },\n })\n\n const res = await customAdapter.create({\n model: 'user',\n data: {\n id: '1',\n name: 'user4',\n email: 'user4@email.com',\n emailVerified: true,\n createdAt: new Date(),\n updatedAt: new Date(),\n },\n })\n\n expect(res.id).toBe('mocked-id')\n })\n}\n"],"names":["expect","test","generateId","runAdapterTest","opts","adapter","getAdapter","user","id","name","email","emailVerified","createdAt","Date","updatedAt","res","create","model","data","toEqual","findOne","where","field","value","select","newEmail","update","toMatchObject","findMany","length","toBe","newUser","operator","token","session","userId","expiresAt","resToken","sortBy","direction","res2","limit","updateMany","updatedUser","delete","findRes","toBeNull","findResFirst","deleteMany","skipIf","skipGenerateIdTest","customAdapter","advanced"],"mappings":"AAAA,SAASA,MAAM,EAAEC,IAAI,QAAQ,SAAQ;AAGrC,SAASC,UAAU,QAAQ,cAAa;AAOxC,OAAO,eAAeC,eAAeC,IAAwB;IAC3D,MAAMC,UAAU,MAAMD,KAAKE,UAAU;IACrC,MAAMC,OAAO;QACXC,IAAI;QACJC,MAAM;QACNC,OAAO;QACPC,eAAe;QACfC,WAAW,IAAIC;QACfC,WAAW,IAAID;IACjB;IAEAZ,KAAK,gBAAgB;QACnB,MAAMc,MAAM,MAAMV,QAAQW,MAAM,CAAC;YAC/BC,OAAO;YACPC,MAAMX;QACR;QACAP,OAAO;YACLS,MAAMM,IAAIN,IAAI;YACdC,OAAOK,IAAIL,KAAK;QAClB,GAAGS,OAAO,CAAC;YACTV,MAAMF,KAAKE,IAAI;YACfC,OAAOH,KAAKG,KAAK;QACnB;QACAH,KAAKC,EAAE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