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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function loadClerkInstance() {
|
|
2
|
+
if (typeof window === 'undefined') return;
|
|
3
|
+
if (window.clerkInstance) return window.clerkInstance;
|
|
4
|
+
const { Clerk } = await import('@clerk/clerk-js');
|
|
5
|
+
const clerkInstance = new Clerk(process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY);
|
|
6
|
+
clerkInstance.load();
|
|
7
|
+
window.clerkInstance = clerkInstance;
|
|
8
|
+
return clerkInstance;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGVyay91dGlscy9sb2FkLWNsZXJrLWluc3RhbmNlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ2xlcmsgfSBmcm9tICdAY2xlcmsvY2xlcmstanMnO1xuXG5kZWNsYXJlIGdsb2JhbCB7XG4gIGludGVyZmFjZSBXaW5kb3cge1xuICAgIGNsZXJrSW5zdGFuY2U/OiBDbGVyaztcbiAgfVxufVxuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gbG9hZENsZXJrSW5zdGFuY2UoKSB7XG4gIGlmICh0eXBlb2Ygd2luZG93ID09PSAndW5kZWZpbmVkJykgcmV0dXJuO1xuICBpZiAod2luZG93LmNsZXJrSW5zdGFuY2UpIHJldHVybiB3aW5kb3cuY2xlcmtJbnN0YW5jZTtcbiAgY29uc3QgeyBDbGVyayB9ID0gYXdhaXQgaW1wb3J0KCdAY2xlcmsvY2xlcmstanMnKTtcbiAgY29uc3QgY2xlcmtJbnN0YW5jZSA9IG5ldyBDbGVyayhwcm9jZXNzLmVudi5ORVhUX1BVQkxJQ19DTEVSS19QVUJMSVNIQUJMRV9LRVkhKTtcbiAgY2xlcmtJbnN0YW5jZS5sb2FkKCk7XG4gIHdpbmRvdy5jbGVya0luc3RhbmNlID0gY2xlcmtJbnN0YW5jZTtcbiAgcmV0dXJuIGNsZXJrSW5zdGFuY2U7XG59Il0sIm5hbWVzIjpbImxvYWRDbGVya0luc3RhbmNlIiwid2luZG93IiwiY2xlcmtJbnN0YW5jZSIsIkNsZXJrIiwicHJvY2VzcyIsImVudiIsIk5FWFRfUFVCTElDX0NMRVJLX1BVQkxJU0hBQkxFX0tFWSIsImxvYWQiXSwibWFwcGluZ3MiOiJBQVFBLE9BQU8sZUFBZUE7SUFDcEIsSUFBSSxPQUFPQyxXQUFXLGFBQWE7SUFDbkMsSUFBSUEsT0FBT0MsYUFBYSxFQUFFLE9BQU9ELE9BQU9DLGFBQWE7SUFDckQsTUFBTSxFQUFFQyxLQUFLLEVBQUUsR0FBRyxNQUFNLE1BQU0sQ0FBQztJQUMvQixNQUFNRCxnQkFBZ0IsSUFBSUMsTUFBTUMsUUFBUUMsR0FBRyxDQUFDQyxpQ0FBaUM7SUFDN0VKLGNBQWNLLElBQUk7SUFDbEJOLE9BQU9DLGFBQWEsR0FBR0E7SUFDdkIsT0FBT0E7QUFDVCJ9
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PayloadRequest } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a webhook request using Svix
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateWebhook({ request, secret, }: {
|
|
6
|
+
request: PayloadRequest;
|
|
7
|
+
secret?: string;
|
|
8
|
+
}): Promise<boolean>;
|
|
9
|
+
//# sourceMappingURL=svix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svix.d.ts","sourceRoot":"","sources":["../../../src/clerk/utils/svix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;GAEG;AACH,wBAAsB,eAAe,CAAC,EACpC,OAAO,EACP,MAAM,GACP,EAAE;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,OAAO,CAAC,OAAO,CAAC,CA6CnB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Webhook } from 'svix';
|
|
2
|
+
/**
|
|
3
|
+
* Validates a webhook request using Svix
|
|
4
|
+
*/ export async function validateWebhook({ request, secret }) {
|
|
5
|
+
// Verify we have the needed methods on the request
|
|
6
|
+
if (!request.clone || typeof request.clone !== 'function') {
|
|
7
|
+
console.error('Svix validation error: request.clone method not available');
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const webhookSecret = secret || process.env.CLERK_WEBHOOK_SECRET || process.env.SVIX_WEBHOOK_SECRET;
|
|
11
|
+
if (!webhookSecret) {
|
|
12
|
+
console.warn('Clerk webhook called without Svix validation - not recommended for production');
|
|
13
|
+
return process.env.NODE_ENV !== 'production';
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const headers = request.headers;
|
|
17
|
+
const svixId = headers.get('svix-id');
|
|
18
|
+
const svixTimestamp = headers.get('svix-timestamp');
|
|
19
|
+
const svixSignature = headers.get('svix-signature');
|
|
20
|
+
if (!svixId || !svixTimestamp || !svixSignature) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
const webhook = new Webhook(webhookSecret);
|
|
24
|
+
const svixHeaders = {
|
|
25
|
+
'svix-id': svixId,
|
|
26
|
+
'svix-timestamp': svixTimestamp,
|
|
27
|
+
'svix-signature': svixSignature
|
|
28
|
+
};
|
|
29
|
+
// Clone the request to avoid consuming the body
|
|
30
|
+
const clonedRequest = request.clone();
|
|
31
|
+
const body = await clonedRequest.text();
|
|
32
|
+
await webhook.verify(body, svixHeaders);
|
|
33
|
+
return true;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error('Svix webhook verification failed:', error);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGVyay91dGlscy9zdml4LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QgfSBmcm9tICdwYXlsb2FkJ1xuaW1wb3J0IHsgV2ViaG9vayB9IGZyb20gJ3N2aXgnXG5cbi8qKlxuICogVmFsaWRhdGVzIGEgd2ViaG9vayByZXF1ZXN0IHVzaW5nIFN2aXhcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHZhbGlkYXRlV2ViaG9vayh7XG4gIHJlcXVlc3QsXG4gIHNlY3JldCxcbn06IHtcbiAgcmVxdWVzdDogUGF5bG9hZFJlcXVlc3RcbiAgc2VjcmV0Pzogc3RyaW5nXG59KTogUHJvbWlzZTxib29sZWFuPiB7XG4gIC8vIFZlcmlmeSB3ZSBoYXZlIHRoZSBuZWVkZWQgbWV0aG9kcyBvbiB0aGUgcmVxdWVzdFxuICBpZiAoIXJlcXVlc3QuY2xvbmUgfHwgdHlwZW9mIHJlcXVlc3QuY2xvbmUgIT09ICdmdW5jdGlvbicpIHtcbiAgICBjb25zb2xlLmVycm9yKCdTdml4IHZhbGlkYXRpb24gZXJyb3I6IHJlcXVlc3QuY2xvbmUgbWV0aG9kIG5vdCBhdmFpbGFibGUnKVxuICAgIHJldHVybiBmYWxzZVxuICB9XG5cbiAgY29uc3Qgd2ViaG9va1NlY3JldCA9IHNlY3JldCB8fCBcbiAgICBwcm9jZXNzLmVudi5DTEVSS19XRUJIT09LX1NFQ1JFVCB8fCBcbiAgICBwcm9jZXNzLmVudi5TVklYX1dFQkhPT0tfU0VDUkVUXG5cbiAgaWYgKCF3ZWJob29rU2VjcmV0KSB7XG4gICAgY29uc29sZS53YXJuKCdDbGVyayB3ZWJob29rIGNhbGxlZCB3aXRob3V0IFN2aXggdmFsaWRhdGlvbiAtIG5vdCByZWNvbW1lbmRlZCBmb3IgcHJvZHVjdGlvbicpXG4gICAgcmV0dXJuIHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbidcbiAgfVxuXG4gIHRyeSB7XG4gICAgY29uc3QgaGVhZGVycyA9IHJlcXVlc3QuaGVhZGVyc1xuXG4gICAgY29uc3Qgc3ZpeElkID0gaGVhZGVycy5nZXQoJ3N2aXgtaWQnKVxuICAgIGNvbnN0IHN2aXhUaW1lc3RhbXAgPSBoZWFkZXJzLmdldCgnc3ZpeC10aW1lc3RhbXAnKVxuICAgIGNvbnN0IHN2aXhTaWduYXR1cmUgPSBoZWFkZXJzLmdldCgnc3ZpeC1zaWduYXR1cmUnKVxuXG4gICAgaWYgKCFzdml4SWQgfHwgIXN2aXhUaW1lc3RhbXAgfHwgIXN2aXhTaWduYXR1cmUpIHtcbiAgICAgIHJldHVybiBmYWxzZVxuICAgIH1cblxuICAgIGNvbnN0IHdlYmhvb2sgPSBuZXcgV2ViaG9vayh3ZWJob29rU2VjcmV0KVxuXG4gICAgY29uc3Qgc3ZpeEhlYWRlcnMgPSB7XG4gICAgICAnc3ZpeC1pZCc6IHN2aXhJZCxcbiAgICAgICdzdml4LXRpbWVzdGFtcCc6IHN2aXhUaW1lc3RhbXAsXG4gICAgICAnc3ZpeC1zaWduYXR1cmUnOiBzdml4U2lnbmF0dXJlLFxuICAgIH1cblxuICAgIC8vIENsb25lIHRoZSByZXF1ZXN0IHRvIGF2b2lkIGNvbnN1bWluZyB0aGUgYm9keVxuICAgIGNvbnN0IGNsb25lZFJlcXVlc3QgPSByZXF1ZXN0LmNsb25lKClcbiAgICBjb25zdCBib2R5ID0gYXdhaXQgY2xvbmVkUmVxdWVzdC50ZXh0KClcbiAgICBcbiAgICBhd2FpdCB3ZWJob29rLnZlcmlmeShib2R5LCBzdml4SGVhZGVycylcbiAgICByZXR1cm4gdHJ1ZVxuICB9IGNhdGNoIChlcnJvcikge1xuICAgIGNvbnNvbGUuZXJyb3IoJ1N2aXggd2ViaG9vayB2ZXJpZmljYXRpb24gZmFpbGVkOicsIGVycm9yKVxuICAgIHJldHVybiBmYWxzZVxuICB9XG59ICJdLCJuYW1lcyI6WyJXZWJob29rIiwidmFsaWRhdGVXZWJob29rIiwicmVxdWVzdCIsInNlY3JldCIsImNsb25lIiwiY29uc29sZSIsImVycm9yIiwid2ViaG9va1NlY3JldCIsInByb2Nlc3MiLCJlbnYiLCJDTEVSS19XRUJIT09LX1NFQ1JFVCIsIlNWSVhfV0VCSE9PS19TRUNSRVQiLCJ3YXJuIiwiTk9ERV9FTlYiLCJoZWFkZXJzIiwic3ZpeElkIiwiZ2V0Iiwic3ZpeFRpbWVzdGFtcCIsInN2aXhTaWduYXR1cmUiLCJ3ZWJob29rIiwic3ZpeEhlYWRlcnMiLCJjbG9uZWRSZXF1ZXN0IiwiYm9keSIsInRleHQiLCJ2ZXJpZnkiXSwibWFwcGluZ3MiOiJBQUNBLFNBQVNBLE9BQU8sUUFBUSxPQUFNO0FBRTlCOztDQUVDLEdBQ0QsT0FBTyxlQUFlQyxnQkFBZ0IsRUFDcENDLE9BQU8sRUFDUEMsTUFBTSxFQUlQO0lBQ0MsbURBQW1EO0lBQ25ELElBQUksQ0FBQ0QsUUFBUUUsS0FBSyxJQUFJLE9BQU9GLFFBQVFFLEtBQUssS0FBSyxZQUFZO1FBQ3pEQyxRQUFRQyxLQUFLLENBQUM7UUFDZCxPQUFPO0lBQ1Q7SUFFQSxNQUFNQyxnQkFBZ0JKLFVBQ3BCSyxRQUFRQyxHQUFHLENBQUNDLG9CQUFvQixJQUNoQ0YsUUFBUUMsR0FBRyxDQUFDRSxtQkFBbUI7SUFFakMsSUFBSSxDQUFDSixlQUFlO1FBQ2xCRixRQUFRTyxJQUFJLENBQUM7UUFDYixPQUFPSixRQUFRQyxHQUFHLENBQUNJLFFBQVEsS0FBSztJQUNsQztJQUVBLElBQUk7UUFDRixNQUFNQyxVQUFVWixRQUFRWSxPQUFPO1FBRS9CLE1BQU1DLFNBQVNELFFBQVFFLEdBQUcsQ0FBQztRQUMzQixNQUFNQyxnQkFBZ0JILFFBQVFFLEdBQUcsQ0FBQztRQUNsQyxNQUFNRSxnQkFBZ0JKLFFBQVFFLEdBQUcsQ0FBQztRQUVsQyxJQUFJLENBQUNELFVBQVUsQ0FBQ0UsaUJBQWlCLENBQUNDLGVBQWU7WUFDL0MsT0FBTztRQUNUO1FBRUEsTUFBTUMsVUFBVSxJQUFJbkIsUUFBUU87UUFFNUIsTUFBTWEsY0FBYztZQUNsQixXQUFXTDtZQUNYLGtCQUFrQkU7WUFDbEIsa0JBQWtCQztRQUNwQjtRQUVBLGdEQUFnRDtRQUNoRCxNQUFNRyxnQkFBZ0JuQixRQUFRRSxLQUFLO1FBQ25DLE1BQU1rQixPQUFPLE1BQU1ELGNBQWNFLElBQUk7UUFFckMsTUFBTUosUUFBUUssTUFBTSxDQUFDRixNQUFNRjtRQUMzQixPQUFPO0lBQ1QsRUFBRSxPQUFPZCxPQUFPO1FBQ2RELFFBQVFDLEtBQUssQ0FBQyxxQ0FBcUNBO1FBQ25ELE9BQU87SUFDVDtBQUNGIn0=
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-related utility functions for the Clerk plugin
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Find a user in Payload by their Clerk ID or primary email
|
|
6
|
+
*/
|
|
7
|
+
export declare function findUserFromClerkUser({ payload, userSlug, clerkUser }: {
|
|
8
|
+
payload: any;
|
|
9
|
+
userSlug: string;
|
|
10
|
+
clerkUser: any;
|
|
11
|
+
}): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Get a user by their Clerk ID
|
|
14
|
+
* Returns the first user found or null if not found
|
|
15
|
+
*/
|
|
16
|
+
export declare function getUserByClerkId(payload: any, userSlug: string, clerkId: string): Promise<any>;
|
|
17
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/clerk/utils/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,OAAO,EACP,QAAQ,EACR,SAAS,EACV,EAAE;IACD,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,GAAG,CAAC;CAChB,gBAwBA;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAcrF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-related utility functions for the Clerk plugin
|
|
3
|
+
*/ /**
|
|
4
|
+
* Find a user in Payload by their Clerk ID or primary email
|
|
5
|
+
*/ export async function findUserFromClerkUser({ payload, userSlug, clerkUser }) {
|
|
6
|
+
const primaryEmailObj = clerkUser.email_addresses?.find((email)=>email.id === clerkUser.primary_email_address_id);
|
|
7
|
+
const primaryEmail = primaryEmailObj?.email_address;
|
|
8
|
+
return payload.find({
|
|
9
|
+
collection: userSlug,
|
|
10
|
+
where: {
|
|
11
|
+
or: [
|
|
12
|
+
{
|
|
13
|
+
clerkId: {
|
|
14
|
+
equals: clerkUser.id
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
primaryEmail ? {
|
|
18
|
+
email: {
|
|
19
|
+
equals: primaryEmail
|
|
20
|
+
}
|
|
21
|
+
} : undefined
|
|
22
|
+
].filter(Boolean)
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get a user by their Clerk ID
|
|
28
|
+
* Returns the first user found or null if not found
|
|
29
|
+
*/ export async function getUserByClerkId(payload, userSlug, clerkId) {
|
|
30
|
+
if (!clerkId) return null;
|
|
31
|
+
try {
|
|
32
|
+
const result = await findUserFromClerkUser({
|
|
33
|
+
payload,
|
|
34
|
+
userSlug,
|
|
35
|
+
clerkUser: {
|
|
36
|
+
id: clerkId
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return result.docs.length > 0 ? result.docs[0] : null;
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error('Error finding user by Clerk ID:', error);
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGVyay91dGlscy91c2VyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVXNlci1yZWxhdGVkIHV0aWxpdHkgZnVuY3Rpb25zIGZvciB0aGUgQ2xlcmsgcGx1Z2luXG4gKi9cblxuLyoqXG4gKiBGaW5kIGEgdXNlciBpbiBQYXlsb2FkIGJ5IHRoZWlyIENsZXJrIElEIG9yIHByaW1hcnkgZW1haWxcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGZpbmRVc2VyRnJvbUNsZXJrVXNlcih7IFxuICBwYXlsb2FkLCBcbiAgdXNlclNsdWcsIFxuICBjbGVya1VzZXIgXG59OiB7IFxuICBwYXlsb2FkOiBhbnk7IFxuICB1c2VyU2x1Zzogc3RyaW5nOyBcbiAgY2xlcmtVc2VyOiBhbnk7XG59KSB7XG4gIGNvbnN0IHByaW1hcnlFbWFpbE9iaiA9IGNsZXJrVXNlci5lbWFpbF9hZGRyZXNzZXM/LmZpbmQoXG4gICAgKGVtYWlsOiBhbnkpID0+IGVtYWlsLmlkID09PSBjbGVya1VzZXIucHJpbWFyeV9lbWFpbF9hZGRyZXNzX2lkXG4gICk7XG4gIFxuICBjb25zdCBwcmltYXJ5RW1haWwgPSBwcmltYXJ5RW1haWxPYmo/LmVtYWlsX2FkZHJlc3M7XG4gIFxuICByZXR1cm4gcGF5bG9hZC5maW5kKHtcbiAgICBjb2xsZWN0aW9uOiB1c2VyU2x1ZyxcbiAgICB3aGVyZToge1xuICAgICAgb3I6IFtcbiAgICAgICAge1xuICAgICAgICAgIGNsZXJrSWQ6IHtcbiAgICAgICAgICAgIGVxdWFsczogY2xlcmtVc2VyLmlkLFxuICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHByaW1hcnlFbWFpbCA/IHtcbiAgICAgICAgICBlbWFpbDoge1xuICAgICAgICAgICAgZXF1YWxzOiBwcmltYXJ5RW1haWwsXG4gICAgICAgICAgfSxcbiAgICAgICAgfSA6IHVuZGVmaW5lZCxcbiAgICAgIF0uZmlsdGVyKEJvb2xlYW4pLFxuICAgIH0sXG4gIH0pO1xufVxuXG4vKipcbiAqIEdldCBhIHVzZXIgYnkgdGhlaXIgQ2xlcmsgSURcbiAqIFJldHVybnMgdGhlIGZpcnN0IHVzZXIgZm91bmQgb3IgbnVsbCBpZiBub3QgZm91bmRcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGdldFVzZXJCeUNsZXJrSWQocGF5bG9hZDogYW55LCB1c2VyU2x1Zzogc3RyaW5nLCBjbGVya0lkOiBzdHJpbmcpIHtcbiAgaWYgKCFjbGVya0lkKSByZXR1cm4gbnVsbFxuICBcbiAgdHJ5IHtcbiAgICBjb25zdCByZXN1bHQgPSBhd2FpdCBmaW5kVXNlckZyb21DbGVya1VzZXIoeyBcbiAgICAgIHBheWxvYWQsIFxuICAgICAgdXNlclNsdWcsIFxuICAgICAgY2xlcmtVc2VyOiB7IGlkOiBjbGVya0lkIH0gXG4gICAgfSk7XG4gICAgcmV0dXJuIHJlc3VsdC5kb2NzLmxlbmd0aCA+IDAgPyByZXN1bHQuZG9jc1swXSA6IG51bGxcbiAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICBjb25zb2xlLmVycm9yKCdFcnJvciBmaW5kaW5nIHVzZXIgYnkgQ2xlcmsgSUQ6JywgZXJyb3IpXG4gICAgcmV0dXJuIG51bGxcbiAgfVxufSAiXSwibmFtZXMiOlsiZmluZFVzZXJGcm9tQ2xlcmtVc2VyIiwicGF5bG9hZCIsInVzZXJTbHVnIiwiY2xlcmtVc2VyIiwicHJpbWFyeUVtYWlsT2JqIiwiZW1haWxfYWRkcmVzc2VzIiwiZmluZCIsImVtYWlsIiwiaWQiLCJwcmltYXJ5X2VtYWlsX2FkZHJlc3NfaWQiLCJwcmltYXJ5RW1haWwiLCJlbWFpbF9hZGRyZXNzIiwiY29sbGVjdGlvbiIsIndoZXJlIiwib3IiLCJjbGVya0lkIiwiZXF1YWxzIiwidW5kZWZpbmVkIiwiZmlsdGVyIiwiQm9vbGVhbiIsImdldFVzZXJCeUNsZXJrSWQiLCJyZXN1bHQiLCJkb2NzIiwibGVuZ3RoIiwiZXJyb3IiLCJjb25zb2xlIl0sIm1hcHBpbmdzIjoiQUFBQTs7Q0FFQyxHQUVEOztDQUVDLEdBQ0QsT0FBTyxlQUFlQSxzQkFBc0IsRUFDMUNDLE9BQU8sRUFDUEMsUUFBUSxFQUNSQyxTQUFTLEVBS1Y7SUFDQyxNQUFNQyxrQkFBa0JELFVBQVVFLGVBQWUsRUFBRUMsS0FDakQsQ0FBQ0MsUUFBZUEsTUFBTUMsRUFBRSxLQUFLTCxVQUFVTSx3QkFBd0I7SUFHakUsTUFBTUMsZUFBZU4saUJBQWlCTztJQUV0QyxPQUFPVixRQUFRSyxJQUFJLENBQUM7UUFDbEJNLFlBQVlWO1FBQ1pXLE9BQU87WUFDTEMsSUFBSTtnQkFDRjtvQkFDRUMsU0FBUzt3QkFDUEMsUUFBUWIsVUFBVUssRUFBRTtvQkFDdEI7Z0JBQ0Y7Z0JBQ0FFLGVBQWU7b0JBQ2JILE9BQU87d0JBQ0xTLFFBQVFOO29CQUNWO2dCQUNGLElBQUlPO2FBQ0wsQ0FBQ0MsTUFBTSxDQUFDQztRQUNYO0lBQ0Y7QUFDRjtBQUVBOzs7Q0FHQyxHQUNELE9BQU8sZUFBZUMsaUJBQWlCbkIsT0FBWSxFQUFFQyxRQUFnQixFQUFFYSxPQUFlO0lBQ3BGLElBQUksQ0FBQ0EsU0FBUyxPQUFPO0lBRXJCLElBQUk7UUFDRixNQUFNTSxTQUFTLE1BQU1yQixzQkFBc0I7WUFDekNDO1lBQ0FDO1lBQ0FDLFdBQVc7Z0JBQUVLLElBQUlPO1lBQVE7UUFDM0I7UUFDQSxPQUFPTSxPQUFPQyxJQUFJLENBQUNDLE1BQU0sR0FBRyxJQUFJRixPQUFPQyxJQUFJLENBQUMsRUFBRSxHQUFHO0lBQ25ELEVBQUUsT0FBT0UsT0FBTztRQUNkQyxRQUFRRCxLQUFLLENBQUMsbUNBQW1DQTtRQUNqRCxPQUFPO0lBQ1Q7QUFDRiJ9
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// These re-exports will be used by consumers of the library
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
2
|
+
export * from "./better-auth";
|
|
3
|
+
export * from "./clerk";
|
|
4
|
+
export * from "./kinde";
|
|
5
|
+
export * from "./authjs";
|
|
6
6
|
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGVzZSByZS1leHBvcnRzIHdpbGwgYmUgdXNlZCBieSBjb25zdW1lcnMgb2YgdGhlIGxpYnJhcnlcbmV4cG9ydCAqIGZyb20gXCIuL2JldHRlci1hdXRoXCI7XG5leHBvcnQgKiBmcm9tIFwiLi9jbGVya1wiO1xuZXhwb3J0ICogZnJvbSBcIi4va2luZGVcIjtcbmV4cG9ydCAqIGZyb20gXCIuL2F1dGhqc1wiO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDREQUE0RDtBQUM1RCxjQUFjLGdCQUFnQjtBQUM5QixjQUFjLFVBQVU7QUFDeEIsY0FBYyxVQUFVO0FBQ3hCLGNBQWMsV0FBVyJ9
|
package/dist/kinde/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kinde/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAC"}
|
package/dist/kinde/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const kinde = "kinde";
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9raW5kZS9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3Qga2luZGUgPSBcImtpbmRlXCI7XG4iXSwibmFtZXMiOlsia2luZGUiXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sTUFBTUEsUUFBUSxRQUFRIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload-auth",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -37,6 +37,21 @@
|
|
|
37
37
|
"types": "./dist/clerk/index.d.ts",
|
|
38
38
|
"default": "./dist/clerk/index.js"
|
|
39
39
|
},
|
|
40
|
+
"./clerk/plugin": {
|
|
41
|
+
"import": "./dist/clerk/plugin/index.js",
|
|
42
|
+
"types": "./dist/clerk/plugin/index.d.ts",
|
|
43
|
+
"default": "./dist/clerk/plugin/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./clerk/utils": {
|
|
46
|
+
"import": "./dist/clerk/utils/index.js",
|
|
47
|
+
"types": "./dist/clerk/utils/index.d.ts",
|
|
48
|
+
"default": "./dist/clerk/utils/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./clerk/admin/ui": {
|
|
51
|
+
"import": "./dist/clerk/admin-ui.js",
|
|
52
|
+
"types": "./dist/clerk/admin-ui.d.ts",
|
|
53
|
+
"default": "./dist/clerk/admin-ui.js"
|
|
54
|
+
},
|
|
40
55
|
"./kinde": {
|
|
41
56
|
"import": "./dist/kinde/index.js",
|
|
42
57
|
"types": "./dist/kinde/index.d.ts",
|
|
@@ -52,37 +67,48 @@
|
|
|
52
67
|
"files": [
|
|
53
68
|
"dist"
|
|
54
69
|
],
|
|
70
|
+
"scripts": {
|
|
71
|
+
"clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo",
|
|
72
|
+
"build": "pnpm clean && pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
73
|
+
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist",
|
|
74
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
75
|
+
"build:types": "tsc --project tsconfig.json"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@payloadcms/ui": "^3.34.0",
|
|
79
|
+
"payload": "^3.34.0",
|
|
80
|
+
"next": "^15.3.0",
|
|
81
|
+
"react": "^19",
|
|
82
|
+
"react-dom": "^19"
|
|
83
|
+
},
|
|
55
84
|
"devDependencies": {
|
|
85
|
+
"copyfiles": "^2.4.1",
|
|
86
|
+
"@clerk/types": "^4.50.1",
|
|
56
87
|
"@swc/cli": "0.6.0",
|
|
57
88
|
"@swc/core": "1.11.13",
|
|
58
|
-
"
|
|
89
|
+
"@types/node": "^20.0.0",
|
|
90
|
+
"@types/react": "^19",
|
|
91
|
+
"@types/react-dom": "^19",
|
|
92
|
+
"typescript": "5.8.2",
|
|
93
|
+
"vitest": "^1.0.0"
|
|
59
94
|
},
|
|
60
95
|
"dependencies": {
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"@
|
|
96
|
+
"@better-auth/utils": "0.2.4",
|
|
97
|
+
"@clerk/backend": "^1.25.8",
|
|
98
|
+
"@clerk/clerk-js": "^5.58.1",
|
|
99
|
+
"@clerk/nextjs": "^6.12.12",
|
|
65
100
|
"@radix-ui/react-checkbox": "1.1.4",
|
|
66
101
|
"@radix-ui/react-icons": "1.3.2",
|
|
67
102
|
"@radix-ui/react-label": "2.1.2",
|
|
68
103
|
"@radix-ui/react-slot": "1.1.2",
|
|
69
|
-
"
|
|
70
|
-
"better-auth": "1.2.5",
|
|
104
|
+
"better-auth": "1.2.6",
|
|
71
105
|
"class-variance-authority": "0.7.1",
|
|
72
106
|
"clsx": "2.1.1",
|
|
73
107
|
"jose": "^6.0.10",
|
|
74
108
|
"lucide-react": "0.482.0",
|
|
75
|
-
"payload": "3.31",
|
|
76
109
|
"sonner": "2.0.1",
|
|
110
|
+
"svix": "^1.62.0",
|
|
77
111
|
"tailwind-merge": "3.0.2",
|
|
78
112
|
"uncrypto": "^0.1.3"
|
|
79
|
-
},
|
|
80
|
-
"scripts": {
|
|
81
|
-
"clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo",
|
|
82
|
-
"build": "pnpm clean && pnpm copy:dist && pnpm build:swc",
|
|
83
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
84
|
-
"build:types": "tsc --project tsconfig.json",
|
|
85
|
-
"copy:dist": "pnpm copy:provider better-auth && pnpm copy:provider clerk && pnpm copy:provider kinde && pnpm copy:provider authjs",
|
|
86
|
-
"copy:provider": "./copy-provider.sh"
|
|
87
113
|
}
|
|
88
|
-
}
|
|
114
|
+
}
|
package/LICENSE.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
Copyright (c) 2025 - present, Luke Gannon <luke.gannon@me.com>
|
|
3
|
-
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
5
|
-
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
6
|
-
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
7
|
-
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
|
8
|
-
is furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in all copies or
|
|
11
|
-
substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
14
|
-
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
15
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
16
|
-
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/dist/authjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export const authjs = \"authjs\";\n"],"names":["authjs"],"mappings":"AAAA,OAAO,MAAMA,SAAS,SAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { betterAuth } from 'better-auth';
|
|
2
|
-
import { payloadAdapter } from '../..';
|
|
3
|
-
import { getPayload } from '..';
|
|
4
|
-
import { generateSchema } from '../../generate-schema';
|
|
5
|
-
import { getPayloadPath } from '../../generate-schema/utils';
|
|
6
|
-
const PAYLOAD_TEST_DIR_PATH = getPayloadPath('./test/test_payload1');
|
|
7
|
-
const PAYLOAD_TEST_DIR_PATH2 = getPayloadPath('./test/test_payload2');
|
|
8
|
-
const PAYLOAD_TEST_DIR_PATH3 = getPayloadPath('./test/test_payload3');
|
|
9
|
-
const auth = betterAuth({
|
|
10
|
-
database: payloadAdapter(await getPayload()),
|
|
11
|
-
emailAndPassword: {
|
|
12
|
-
enabled: true
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
await generateSchema({
|
|
16
|
-
plugins: [
|
|
17
|
-
{
|
|
18
|
-
id: 'admin',
|
|
19
|
-
schema: {
|
|
20
|
-
admin: {
|
|
21
|
-
fields: {
|
|
22
|
-
name: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
required: true
|
|
25
|
-
},
|
|
26
|
-
id: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
required: true
|
|
29
|
-
},
|
|
30
|
-
isAdmin: {
|
|
31
|
-
type: 'boolean',
|
|
32
|
-
required: true
|
|
33
|
-
},
|
|
34
|
-
status: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
date: {
|
|
39
|
-
type: 'date'
|
|
40
|
-
},
|
|
41
|
-
number: {
|
|
42
|
-
type: 'number'
|
|
43
|
-
},
|
|
44
|
-
str_array: {
|
|
45
|
-
type: 'string[]'
|
|
46
|
-
},
|
|
47
|
-
num_array: {
|
|
48
|
-
type: 'number[]'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}, {
|
|
56
|
-
outputDir: PAYLOAD_TEST_DIR_PATH3
|
|
57
|
-
}).then(()=>{
|
|
58
|
-
process.exit(0);
|
|
59
|
-
}).catch((err)=>{
|
|
60
|
-
console.error(err);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=run.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/adapter/dev/bin/run.ts"],"sourcesContent":["import { betterAuth } from 'better-auth'\nimport { payloadAdapter } from '../..'\nimport { getPayload } from '..'\nimport { generateSchema } from '../../generate-schema'\nimport { getPayloadPath } from '../../generate-schema/utils'\n\nconst PAYLOAD_TEST_DIR_PATH = getPayloadPath('./test/test_payload1')\nconst PAYLOAD_TEST_DIR_PATH2 = getPayloadPath('./test/test_payload2')\nconst PAYLOAD_TEST_DIR_PATH3 = getPayloadPath('./test/test_payload3')\n\nconst auth = betterAuth({\n database: payloadAdapter(await getPayload()),\n emailAndPassword: {\n enabled: true,\n },\n})\n\nawait generateSchema(\n {\n plugins: [\n {\n id: 'admin',\n schema: {\n admin: {\n fields: {\n name: {\n type: 'string',\n required: true,\n },\n id: {\n type: 'string',\n required: true,\n },\n isAdmin: {\n type: 'boolean',\n required: true,\n },\n status: {\n type: 'string',\n required: false,\n },\n date: {\n type: 'date',\n },\n number: {\n type: 'number',\n },\n str_array: {\n type: 'string[]',\n },\n num_array: {\n type: 'number[]',\n },\n },\n },\n },\n },\n ],\n },\n {\n outputDir: PAYLOAD_TEST_DIR_PATH3,\n },\n)\n .then(() => {\n process.exit(0)\n })\n .catch((err) => {\n console.error(err)\n process.exit(1)\n })\n"],"names":["betterAuth","payloadAdapter","getPayload","generateSchema","getPayloadPath","PAYLOAD_TEST_DIR_PATH","PAYLOAD_TEST_DIR_PATH2","PAYLOAD_TEST_DIR_PATH3","auth","database","emailAndPassword","enabled","plugins","id","schema","admin","fields","name","type","required","isAdmin","status","date","number","str_array","num_array","outputDir","then","process","exit","catch","err","console","error"],"mappings":"AAAA,SAASA,UAAU,QAAQ,cAAa;AACxC,SAASC,cAAc,QAAQ,QAAO;AACtC,SAASC,UAAU,QAAQ,KAAI;AAC/B,SAASC,cAAc,QAAQ,wBAAuB;AACtD,SAASC,cAAc,QAAQ,8BAA6B;AAE5D,MAAMC,wBAAwBD,eAAe;AAC7C,MAAME,yBAAyBF,eAAe;AAC9C,MAAMG,yBAAyBH,eAAe;AAE9C,MAAMI,OAAOR,WAAW;IACtBS,UAAUR,eAAe,MAAMC;IAC/BQ,kBAAkB;QAChBC,SAAS;IACX;AACF;AAEA,MAAMR,eACJ;IACES,SAAS;QACP;YACEC,IAAI;YACJC,QAAQ;gBACNC,OAAO;oBACLC,QAAQ;wBACNC,MAAM;4BACJC,MAAM;4BACNC,UAAU;wBACZ;wBACAN,IAAI;4BACFK,MAAM;4BACNC,UAAU;wBACZ;wBACAC,SAAS;4BACPF,MAAM;4BACNC,UAAU;wBACZ;wBACAE,QAAQ;4BACNH,MAAM;4BACNC,UAAU;wBACZ;wBACAG,MAAM;4BACJJ,MAAM;wBACR;wBACAK,QAAQ;4BACNL,MAAM;wBACR;wBACAM,WAAW;4BACTN,MAAM;wBACR;wBACAO,WAAW;4BACTP,MAAM;wBACR;oBACF;gBACF;YACF;QACF;KACD;AACH,GACA;IACEQ,WAAWnB;AACb,GAECoB,IAAI,CAAC;IACJC,QAAQC,IAAI,CAAC;AACf,GACCC,KAAK,CAAC,CAACC;IACNC,QAAQC,KAAK,CAACF;IACdH,QAAQC,IAAI,CAAC;AACf"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
-
*
|
|
4
|
-
* Below is what your Payload collections should look like.
|
|
5
|
-
* Please copy these to your actual collection configs.
|
|
6
|
-
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
-
*
|
|
8
|
-
* Example auth strategy:
|
|
9
|
-
* auth: {
|
|
10
|
-
* disableLocalStrategy: true,
|
|
11
|
-
* strategies: [
|
|
12
|
-
* betterAuthStrategy(),
|
|
13
|
-
* // Add other strategies as needed
|
|
14
|
-
* ],
|
|
15
|
-
* },
|
|
16
|
-
*/
|
|
17
|
-
import type { CollectionConfig } from 'payload';
|
|
18
|
-
declare const User: CollectionConfig;
|
|
19
|
-
declare const Session: CollectionConfig;
|
|
20
|
-
declare const Account: CollectionConfig;
|
|
21
|
-
declare const Verification: CollectionConfig;
|
|
22
|
-
export { User, Session, Account, Verification };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EXAMPLE COLLECTIONS FOR BETTER AUTH
|
|
3
|
-
*
|
|
4
|
-
* Below is what your Payload collections should look like.
|
|
5
|
-
* Please copy these to your actual collection configs.
|
|
6
|
-
* Make sure to add an authStrategy for the users collection if there is one.
|
|
7
|
-
*
|
|
8
|
-
* Example auth strategy:
|
|
9
|
-
* auth: {
|
|
10
|
-
* disableLocalStrategy: true,
|
|
11
|
-
* strategies: [
|
|
12
|
-
* betterAuthStrategy(),
|
|
13
|
-
* // Add other strategies as needed
|
|
14
|
-
* ],
|
|
15
|
-
* },
|
|
16
|
-
*/ const User = {
|
|
17
|
-
slug: 'user',
|
|
18
|
-
admin: {
|
|
19
|
-
useAsTitle: 'name'
|
|
20
|
-
},
|
|
21
|
-
fields: [
|
|
22
|
-
{
|
|
23
|
-
name: 'name',
|
|
24
|
-
type: 'text',
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'email',
|
|
29
|
-
type: 'email',
|
|
30
|
-
required: true,
|
|
31
|
-
unique: true
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'emailVerified',
|
|
35
|
-
type: 'checkbox',
|
|
36
|
-
required: true,
|
|
37
|
-
defaultValue: false
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'image',
|
|
41
|
-
type: 'upload',
|
|
42
|
-
relationTo: 'media'
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
timestamps: true
|
|
46
|
-
};
|
|
47
|
-
const Session = {
|
|
48
|
-
slug: 'session',
|
|
49
|
-
admin: {
|
|
50
|
-
useAsTitle: 'expiresAt'
|
|
51
|
-
},
|
|
52
|
-
fields: [
|
|
53
|
-
{
|
|
54
|
-
name: 'expiresAt',
|
|
55
|
-
type: 'date',
|
|
56
|
-
required: true
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: 'token',
|
|
60
|
-
type: 'text',
|
|
61
|
-
required: true,
|
|
62
|
-
unique: true
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'ipAddress',
|
|
66
|
-
type: 'text'
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'userAgent',
|
|
70
|
-
type: 'text'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'userId',
|
|
74
|
-
type: 'relationship',
|
|
75
|
-
relationTo: 'user',
|
|
76
|
-
required: true
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
timestamps: true
|
|
80
|
-
};
|
|
81
|
-
const Account = {
|
|
82
|
-
slug: 'account',
|
|
83
|
-
admin: {
|
|
84
|
-
useAsTitle: 'accountId'
|
|
85
|
-
},
|
|
86
|
-
fields: [
|
|
87
|
-
{
|
|
88
|
-
name: 'accountId',
|
|
89
|
-
type: 'text',
|
|
90
|
-
required: true
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: 'providerId',
|
|
94
|
-
type: 'text',
|
|
95
|
-
required: true
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: 'userId',
|
|
99
|
-
type: 'relationship',
|
|
100
|
-
relationTo: 'user',
|
|
101
|
-
required: true
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: 'accessToken',
|
|
105
|
-
type: 'text'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: 'refreshToken',
|
|
109
|
-
type: 'text'
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: 'idToken',
|
|
113
|
-
type: 'text'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: 'accessTokenExpiresAt',
|
|
117
|
-
type: 'date'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: 'refreshTokenExpiresAt',
|
|
121
|
-
type: 'date'
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: 'scope',
|
|
125
|
-
type: 'text'
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'password',
|
|
129
|
-
type: 'text'
|
|
130
|
-
}
|
|
131
|
-
],
|
|
132
|
-
timestamps: true
|
|
133
|
-
};
|
|
134
|
-
const Verification = {
|
|
135
|
-
slug: 'verification',
|
|
136
|
-
admin: {
|
|
137
|
-
useAsTitle: 'identifier'
|
|
138
|
-
},
|
|
139
|
-
fields: [
|
|
140
|
-
{
|
|
141
|
-
name: 'identifier',
|
|
142
|
-
type: 'text',
|
|
143
|
-
required: true
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: 'value',
|
|
147
|
-
type: 'text',
|
|
148
|
-
required: true
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'expiresAt',
|
|
152
|
-
type: 'date',
|
|
153
|
-
required: true
|
|
154
|
-
}
|
|
155
|
-
],
|
|
156
|
-
timestamps: true
|
|
157
|
-
};
|
|
158
|
-
export { User, Session, Account, Verification };
|
|
159
|
-
|
|
160
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/adapter/dev/bin/schema.ts"],"sourcesContent":["/**\n * EXAMPLE COLLECTIONS FOR BETTER AUTH\n *\n * Below is what your Payload collections should look like.\n * Please copy these to your actual collection configs.\n * Make sure to add an authStrategy for the users collection if there is one.\n *\n * Example auth strategy:\n * auth: {\n * disableLocalStrategy: true,\n * strategies: [\n * betterAuthStrategy(),\n * // Add other strategies as needed\n * ],\n * },\n */\nimport type { CollectionConfig } from 'payload'\n\nconst User: CollectionConfig = {\n slug: 'user',\n admin: {\n useAsTitle: 'name',\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n },\n {\n name: 'email',\n type: 'email',\n required: true,\n unique: true,\n },\n {\n name: 'emailVerified',\n type: 'checkbox',\n required: true,\n defaultValue: false,\n },\n {\n name: 'image',\n type: 'upload',\n relationTo: 'media',\n },\n ],\n timestamps: true,\n} as const\n\nconst Session: CollectionConfig = {\n slug: 'session',\n admin: {\n useAsTitle: 'expiresAt',\n },\n fields: [\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n {\n name: 'token',\n type: 'text',\n required: true,\n unique: true,\n },\n {\n name: 'ipAddress',\n type: 'text',\n },\n {\n name: 'userAgent',\n type: 'text',\n },\n {\n name: 'userId',\n type: 'relationship',\n relationTo: 'user',\n required: true,\n },\n ],\n timestamps: true,\n} as const\n\nconst Account: CollectionConfig = {\n slug: 'account',\n admin: {\n useAsTitle: 'accountId',\n },\n fields: [\n {\n name: 'accountId',\n type: 'text',\n required: true,\n },\n {\n name: 'providerId',\n type: 'text',\n required: true,\n },\n {\n name: 'userId',\n type: 'relationship',\n relationTo: 'user',\n required: true,\n },\n {\n name: 'accessToken',\n type: 'text',\n },\n {\n name: 'refreshToken',\n type: 'text',\n },\n {\n name: 'idToken',\n type: 'text',\n },\n {\n name: 'accessTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'refreshTokenExpiresAt',\n type: 'date',\n },\n {\n name: 'scope',\n type: 'text',\n },\n {\n name: 'password',\n type: 'text',\n },\n ],\n timestamps: true,\n} as const\n\nconst Verification: CollectionConfig = {\n slug: 'verification',\n admin: {\n useAsTitle: 'identifier',\n },\n fields: [\n {\n name: 'identifier',\n type: 'text',\n required: true,\n },\n {\n name: 'value',\n type: 'text',\n required: true,\n },\n {\n name: 'expiresAt',\n type: 'date',\n required: true,\n },\n ],\n timestamps: true,\n} as const\n\nexport { User, Session, Account, Verification }\n"],"names":["User","slug","admin","useAsTitle","fields","name","type","required","unique","defaultValue","relationTo","timestamps","Session","Account","Verification"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAGD,MAAMA,OAAyB;IAC7BC,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;YACNC,UAAU;YACVE,cAAc;QAChB;QACA;YACEJ,MAAM;YACNC,MAAM;YACNI,YAAY;QACd;KACD;IACDC,YAAY;AACd;AAEA,MAAMC,UAA4B;IAChCX,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;YACVC,QAAQ;QACV;QACA;YACEH,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;YACNI,YAAY;YACZH,UAAU;QACZ;KACD;IACDI,YAAY;AACd;AAEA,MAAME,UAA4B;IAChCZ,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNI,YAAY;YACZH,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;QACA;YACED,MAAM;YACNC,MAAM;QACR;KACD;IACDK,YAAY;AACd;AAEA,MAAMG,eAAiC;IACrCb,MAAM;IACNC,OAAO;QACLC,YAAY;IACd;IACAC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;QACA;YACEF,MAAM;YACNC,MAAM;YACNC,UAAU;QACZ;KACD;IACDI,YAAY;AACd;AAEA,SAASX,IAAI,EAAEY,OAAO,EAAEC,OAAO,EAAEC,YAAY,GAAE"}
|