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,298 +0,0 @@
|
|
|
1
|
-
import { supportedBetterAuthPluginIds, betterAuthPluginSlugs, baseCollectionSlugs } from './config';
|
|
2
|
-
import { ensurePasswordSetBeforeUserCreate } from './ensure-password-set-before-create';
|
|
3
|
-
import { verifyPassword, hashPassword } from './password';
|
|
4
|
-
/**
|
|
5
|
-
* Sanitizes the BetterAuth options
|
|
6
|
-
*/ export function sanitizeBetterAuthOptions(options) {
|
|
7
|
-
const baOptions = options.betterAuthOptions;
|
|
8
|
-
const userCollectionSlug = options.users?.slug ?? 'users';
|
|
9
|
-
const accountCollectionSlug = options.accounts?.slug ?? 'accounts';
|
|
10
|
-
const sessionCollectionSlug = options.sessions?.slug ?? 'sessions';
|
|
11
|
-
const verificationCollectionSlug = options.verifications?.slug ?? 'verifications';
|
|
12
|
-
const res = {
|
|
13
|
-
...baOptions
|
|
14
|
-
};
|
|
15
|
-
res.user = {
|
|
16
|
-
...baOptions?.user ?? {},
|
|
17
|
-
modelName: userCollectionSlug
|
|
18
|
-
};
|
|
19
|
-
res.account = {
|
|
20
|
-
...baOptions?.account ?? {},
|
|
21
|
-
modelName: accountCollectionSlug,
|
|
22
|
-
fields: {
|
|
23
|
-
userId: 'user'
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
res.session = {
|
|
27
|
-
...baOptions?.session ?? {},
|
|
28
|
-
modelName: sessionCollectionSlug,
|
|
29
|
-
fields: {
|
|
30
|
-
userId: 'user'
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
res.verification = {
|
|
34
|
-
...baOptions?.verification ?? {},
|
|
35
|
-
modelName: verificationCollectionSlug
|
|
36
|
-
};
|
|
37
|
-
res.emailAndPassword = {
|
|
38
|
-
...baOptions?.emailAndPassword ?? {},
|
|
39
|
-
enabled: baOptions?.emailAndPassword?.enabled ?? true
|
|
40
|
-
};
|
|
41
|
-
if (res.emailAndPassword.enabled) {
|
|
42
|
-
res.emailAndPassword.password = {
|
|
43
|
-
...res.emailAndPassword.password ?? {},
|
|
44
|
-
verify: async ({ hash, password })=>{
|
|
45
|
-
return await verifyPassword({
|
|
46
|
-
hash,
|
|
47
|
-
password
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
hash: async (password)=>{
|
|
51
|
-
return await hashPassword(password);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
if (Boolean(options.users?.blockFirstBetterAuthVerificationEmail)) {
|
|
56
|
-
const originalSendVerificationEmail = baOptions?.emailVerification?.sendVerificationEmail;
|
|
57
|
-
// Only override sendVerificationEmail if the developer provided their own implementation
|
|
58
|
-
if (typeof originalSendVerificationEmail === 'function') {
|
|
59
|
-
res.emailVerification = res?.emailVerification || {};
|
|
60
|
-
res.emailVerification.sendVerificationEmail = async (data, request)=>{
|
|
61
|
-
try {
|
|
62
|
-
const user = data.user;
|
|
63
|
-
const createdAt = new Date(user.createdAt);
|
|
64
|
-
const now = new Date();
|
|
65
|
-
// If the user was created less than one minute ago, don't send the verification email
|
|
66
|
-
// as we rely on payload to send the initial email
|
|
67
|
-
if (now.getTime() - createdAt.getTime() < 60000) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
await originalSendVerificationEmail(data, request);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
console.error('Error sending verification email:', error);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
ensurePasswordSetBeforeUserCreate(res);
|
|
78
|
-
if (res.plugins) {
|
|
79
|
-
try {
|
|
80
|
-
const supportedPlugins = res.plugins.filter((plugin)=>{
|
|
81
|
-
return Object.values(supportedBetterAuthPluginIds).includes(plugin.id);
|
|
82
|
-
});
|
|
83
|
-
if (supportedPlugins.length !== res.plugins.length) {
|
|
84
|
-
console.warn(`Unsupported BetterAuth plugins detected: ${res.plugins.filter((p)=>!Object.values(supportedBetterAuthPluginIds).includes(p.id)).map((p)=>p.id).join(', ')}. Supported plugins are: ${Object.values(supportedBetterAuthPluginIds).join(', ')}.
|
|
85
|
-
These plugins will be ignored.`);
|
|
86
|
-
}
|
|
87
|
-
// Add the schema to the supported plugins
|
|
88
|
-
if (supportedPlugins.length > 0) {
|
|
89
|
-
supportedPlugins.forEach((plugin)=>{
|
|
90
|
-
const pluginId = plugin.id;
|
|
91
|
-
switch(pluginId){
|
|
92
|
-
case supportedBetterAuthPluginIds.admin:
|
|
93
|
-
const adminPlugin = plugin;
|
|
94
|
-
if (!adminPlugin.adminRoles) adminPlugin.adminRoles = options.users?.adminRoles ?? [
|
|
95
|
-
'admin'
|
|
96
|
-
];
|
|
97
|
-
adminPlugin.adminRoles = options.users?.adminRoles ?? [
|
|
98
|
-
'admin'
|
|
99
|
-
];
|
|
100
|
-
Object.assign(plugin, adminPlugin);
|
|
101
|
-
break;
|
|
102
|
-
case supportedBetterAuthPluginIds.apiKey:
|
|
103
|
-
const apiKeyPlugin = plugin;
|
|
104
|
-
if (!apiKeyPlugin.schema) apiKeyPlugin.schema = {};
|
|
105
|
-
if (!apiKeyPlugin.schema.apikey) apiKeyPlugin.schema.apikey = {};
|
|
106
|
-
apiKeyPlugin.schema.apikey = {
|
|
107
|
-
...apiKeyPlugin.schema.apikey,
|
|
108
|
-
modelName: betterAuthPluginSlugs.apiKeys,
|
|
109
|
-
fields: {
|
|
110
|
-
...plugin.schema?.apikey?.fields ?? {},
|
|
111
|
-
userId: {
|
|
112
|
-
...plugin.schema?.apikey?.fields?.userId ?? {},
|
|
113
|
-
fieldName: 'user'
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
Object.assign(plugin, apiKeyPlugin);
|
|
118
|
-
break;
|
|
119
|
-
case supportedBetterAuthPluginIds.passkey:
|
|
120
|
-
const passkeyPlugin = plugin;
|
|
121
|
-
if (!passkeyPlugin.schema) passkeyPlugin.schema = {};
|
|
122
|
-
if (!passkeyPlugin.schema.passkey) passkeyPlugin.schema.passkey = {};
|
|
123
|
-
passkeyPlugin.schema.passkey = {
|
|
124
|
-
...passkeyPlugin.schema.passkey,
|
|
125
|
-
modelName: betterAuthPluginSlugs.passkeys,
|
|
126
|
-
fields: {
|
|
127
|
-
...passkeyPlugin.schema.passkey.fields || {},
|
|
128
|
-
userId: {
|
|
129
|
-
...passkeyPlugin.schema.passkey.fields.userId,
|
|
130
|
-
fieldName: 'user'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
Object.assign(plugin, passkeyPlugin);
|
|
135
|
-
break;
|
|
136
|
-
case supportedBetterAuthPluginIds.organization:
|
|
137
|
-
const organizationPlugin = plugin;
|
|
138
|
-
if (!organizationPlugin.schema) organizationPlugin.schema = {};
|
|
139
|
-
if (!organizationPlugin.schema.organization) organizationPlugin.schema.member = {};
|
|
140
|
-
if (!organizationPlugin.schema.invitation) organizationPlugin.schema.invitation = {};
|
|
141
|
-
if (!organizationPlugin.schema.team) organizationPlugin.schema.team = {};
|
|
142
|
-
if (!organizationPlugin.schema.session) organizationPlugin.schema.session = {};
|
|
143
|
-
organizationPlugin.schema = {
|
|
144
|
-
...organizationPlugin.schema,
|
|
145
|
-
organization: {
|
|
146
|
-
...organizationPlugin.schema.organization,
|
|
147
|
-
modelName: betterAuthPluginSlugs.organizations,
|
|
148
|
-
fields: {
|
|
149
|
-
...organizationPlugin.schema.organization.fields ?? {}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
member: {
|
|
153
|
-
...organizationPlugin.schema.member,
|
|
154
|
-
modelName: betterAuthPluginSlugs.members,
|
|
155
|
-
fields: {
|
|
156
|
-
...organizationPlugin.schema.member.fields ?? {},
|
|
157
|
-
organizationId: {
|
|
158
|
-
...organizationPlugin.schema.member.fields?.organizationId ?? {},
|
|
159
|
-
fieldName: 'organization'
|
|
160
|
-
},
|
|
161
|
-
userId: {
|
|
162
|
-
...organizationPlugin.schema.member.fields?.userId ?? {},
|
|
163
|
-
fieldName: 'user'
|
|
164
|
-
},
|
|
165
|
-
teamId: {
|
|
166
|
-
...organizationPlugin.schema.member.fields?.teamId ?? {},
|
|
167
|
-
fieldName: 'team'
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
invitation: {
|
|
172
|
-
...organizationPlugin.schema.invitation,
|
|
173
|
-
modelName: betterAuthPluginSlugs.invitations,
|
|
174
|
-
fields: {
|
|
175
|
-
...organizationPlugin.schema.invitation.fields ?? {},
|
|
176
|
-
organizationId: {
|
|
177
|
-
...organizationPlugin.schema.invitation.fields?.organizationId ?? {},
|
|
178
|
-
fieldName: 'organization'
|
|
179
|
-
},
|
|
180
|
-
inviterId: {
|
|
181
|
-
...organizationPlugin.schema.invitation.fields?.inviterId ?? {},
|
|
182
|
-
fieldName: 'inviter'
|
|
183
|
-
},
|
|
184
|
-
teamId: {
|
|
185
|
-
...organizationPlugin.schema.invitation.fields?.teamId ?? {},
|
|
186
|
-
fieldName: 'team'
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
team: {
|
|
191
|
-
...organizationPlugin.schema.team,
|
|
192
|
-
modelName: betterAuthPluginSlugs.teams,
|
|
193
|
-
fields: {
|
|
194
|
-
...organizationPlugin.schema.team.fields ?? {},
|
|
195
|
-
organizationId: {
|
|
196
|
-
...organizationPlugin.schema.team.fields?.organizationId ?? {},
|
|
197
|
-
fieldName: 'organization'
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
session: {
|
|
202
|
-
...organizationPlugin.schema.session,
|
|
203
|
-
modelName: baseCollectionSlugs.sessions,
|
|
204
|
-
fields: {
|
|
205
|
-
...organizationPlugin.schema.session.fields ?? {},
|
|
206
|
-
activeOrganizationId: {
|
|
207
|
-
...organizationPlugin.schema.session.fields?.activeOrganizationId ?? {},
|
|
208
|
-
fieldName: 'activeOrganization'
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
Object.assign(plugin, organizationPlugin);
|
|
214
|
-
break;
|
|
215
|
-
case supportedBetterAuthPluginIds.sso:
|
|
216
|
-
const ssoPlugin = plugin;
|
|
217
|
-
if (!ssoPlugin.schema) ssoPlugin.schema = {};
|
|
218
|
-
if (!ssoPlugin.schema.sso) ssoPlugin.schema.sso = {};
|
|
219
|
-
ssoPlugin.schema.sso = {
|
|
220
|
-
...ssoPlugin.schema.sso,
|
|
221
|
-
modelName: betterAuthPluginSlugs.ssoProviders,
|
|
222
|
-
fields: {
|
|
223
|
-
...ssoPlugin.schema.sso.fields ?? {},
|
|
224
|
-
userId: {
|
|
225
|
-
...ssoPlugin.schema.sso.fields?.userId ?? {},
|
|
226
|
-
fieldName: 'user'
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
Object.assign(plugin, ssoPlugin);
|
|
231
|
-
break;
|
|
232
|
-
case supportedBetterAuthPluginIds.oidc:
|
|
233
|
-
const oidcPlugin = plugin;
|
|
234
|
-
if (!oidcPlugin.schema) oidcPlugin.schema = {};
|
|
235
|
-
if (!oidcPlugin.schema.oauthApplication) oidcPlugin.schema.oauthApplication = {};
|
|
236
|
-
if (!oidcPlugin.schema.oauthAccessToken) oidcPlugin.schema.oauthAccessToken = {};
|
|
237
|
-
if (!oidcPlugin.schema.oauthConsent) oidcPlugin.schema.oauthConsent = {};
|
|
238
|
-
oidcPlugin.schema = {
|
|
239
|
-
...oidcPlugin.schema,
|
|
240
|
-
oauthApplication: {
|
|
241
|
-
...oidcPlugin.schema.oauthApplication,
|
|
242
|
-
modelName: betterAuthPluginSlugs.oauthApplications,
|
|
243
|
-
fields: {
|
|
244
|
-
...oidcPlugin.schema.oauthApplication.fields ?? {},
|
|
245
|
-
userId: {
|
|
246
|
-
...oidcPlugin.schema.oauthApplication.fields?.userId ?? {},
|
|
247
|
-
fieldName: 'user'
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
oauthAccessToken: {
|
|
252
|
-
...oidcPlugin.schema.oauthAccessToken,
|
|
253
|
-
modelName: betterAuthPluginSlugs.oauthAccessTokens,
|
|
254
|
-
fields: {
|
|
255
|
-
...oidcPlugin.schema.oauthAccessToken.fields ?? {},
|
|
256
|
-
userId: {
|
|
257
|
-
...oidcPlugin.schema.oauthAccessToken.fields?.userId ?? {},
|
|
258
|
-
fieldName: 'user'
|
|
259
|
-
},
|
|
260
|
-
clientId: {
|
|
261
|
-
...oidcPlugin.schema.oauthAccessToken.fields?.clientId ?? {},
|
|
262
|
-
fieldName: 'client'
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
oauthConsent: {
|
|
267
|
-
...oidcPlugin.schema.oauthConsent,
|
|
268
|
-
modelName: betterAuthPluginSlugs.oauthConsents,
|
|
269
|
-
fields: {
|
|
270
|
-
...oidcPlugin.schema.oauthConsent.fields ?? {},
|
|
271
|
-
userId: {
|
|
272
|
-
...oidcPlugin.schema.oauthConsent.fields?.userId ?? {},
|
|
273
|
-
fieldName: 'user'
|
|
274
|
-
},
|
|
275
|
-
clientId: {
|
|
276
|
-
...oidcPlugin.schema.oauthConsent.fields?.clientId ?? {},
|
|
277
|
-
fieldName: 'client'
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
Object.assign(plugin, oidcPlugin);
|
|
283
|
-
break;
|
|
284
|
-
default:
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
// Make sure only the supported plugins are used
|
|
290
|
-
Object.assign(res.plugins, supportedPlugins);
|
|
291
|
-
} catch (error) {
|
|
292
|
-
throw new Error(`Error sanitizing BetterAuth plugins: ${error}`);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return res;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
//# sourceMappingURL=sanitize-auth-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/plugin/lib/sanitize-auth-options.ts"],"sourcesContent":["import type { PayloadBetterAuthPluginOptions, SanitizedBetterAuthOptions } from '..'\nimport { supportedBetterAuthPluginIds, betterAuthPluginSlugs, baseCollectionSlugs } from './config'\nimport { ensurePasswordSetBeforeUserCreate } from './ensure-password-set-before-create'\nimport { verifyPassword, hashPassword } from './password'\n\n/**\n * Sanitizes the BetterAuth options\n */\nexport function sanitizeBetterAuthOptions(\n options: PayloadBetterAuthPluginOptions,\n): SanitizedBetterAuthOptions {\n const baOptions = options.betterAuthOptions\n const userCollectionSlug = options.users?.slug ?? 'users'\n const accountCollectionSlug = options.accounts?.slug ?? 'accounts'\n const sessionCollectionSlug = options.sessions?.slug ?? 'sessions'\n const verificationCollectionSlug = options.verifications?.slug ?? 'verifications'\n\n const res: SanitizedBetterAuthOptions = { ...baOptions }\n\n res.user = {\n ...(baOptions?.user ?? {}),\n modelName: userCollectionSlug,\n }\n\n res.account = {\n ...(baOptions?.account ?? {}),\n modelName: accountCollectionSlug,\n fields: {\n userId: 'user',\n },\n }\n\n res.session = {\n ...(baOptions?.session ?? {}),\n modelName: sessionCollectionSlug,\n fields: {\n userId: 'user',\n },\n }\n\n res.verification = {\n ...(baOptions?.verification ?? {}),\n modelName: verificationCollectionSlug,\n }\n\n res.emailAndPassword = {\n ...(baOptions?.emailAndPassword ?? {}),\n enabled: baOptions?.emailAndPassword?.enabled ?? true,\n }\n\n if (res.emailAndPassword.enabled) {\n res.emailAndPassword.password = {\n ...(res.emailAndPassword.password ?? {}),\n verify: async ({ hash, password }) => {\n return await verifyPassword({ hash, password })\n },\n hash: async (password) => {\n return await hashPassword(password)\n },\n }\n }\n\n if (Boolean(options.users?.blockFirstBetterAuthVerificationEmail)) {\n const originalSendVerificationEmail = baOptions?.emailVerification?.sendVerificationEmail\n // Only override sendVerificationEmail if the developer provided their own implementation\n if (typeof originalSendVerificationEmail === 'function') {\n res.emailVerification = res?.emailVerification || {}\n res.emailVerification.sendVerificationEmail = async (data, request) => {\n try {\n const user = data.user\n const createdAt = new Date(user.createdAt)\n const now = new Date()\n // If the user was created less than one minute ago, don't send the verification email\n // as we rely on payload to send the initial email\n if (now.getTime() - createdAt.getTime() < 60000) {\n return\n }\n\n await originalSendVerificationEmail(data, request)\n } catch (error) {\n console.error('Error sending verification email:', error)\n }\n }\n }\n }\n\n ensurePasswordSetBeforeUserCreate(res)\n\n if (res.plugins) {\n try {\n const supportedPlugins = res.plugins.filter((plugin) => {\n return Object.values(supportedBetterAuthPluginIds).includes(\n plugin.id as (typeof supportedBetterAuthPluginIds)[keyof typeof supportedBetterAuthPluginIds],\n )\n })\n\n if (supportedPlugins.length !== res.plugins.length) {\n console.warn(\n `Unsupported BetterAuth plugins detected: ${res.plugins\n .filter(\n (p) =>\n !Object.values(supportedBetterAuthPluginIds).includes(\n p.id as (typeof supportedBetterAuthPluginIds)[keyof typeof supportedBetterAuthPluginIds],\n ),\n )\n .map((p) => p.id)\n .join(', ')}. Supported plugins are: ${Object.values(supportedBetterAuthPluginIds).join(\n ', ',\n )}. \n These plugins will be ignored.`,\n )\n }\n\n // Add the schema to the supported plugins\n if (supportedPlugins.length > 0) {\n supportedPlugins.forEach((plugin) => {\n const pluginId =\n plugin.id as (typeof supportedBetterAuthPluginIds)[keyof typeof supportedBetterAuthPluginIds]\n\n switch (pluginId) {\n case supportedBetterAuthPluginIds.admin:\n const adminPlugin = plugin as any\n if (!adminPlugin.adminRoles)\n adminPlugin.adminRoles = options.users?.adminRoles ?? ['admin']\n adminPlugin.adminRoles = options.users?.adminRoles ?? ['admin']\n Object.assign(plugin, adminPlugin)\n break\n case supportedBetterAuthPluginIds.apiKey:\n const apiKeyPlugin = plugin as any\n if (!apiKeyPlugin.schema) apiKeyPlugin.schema = {}\n if (!apiKeyPlugin.schema.apikey) apiKeyPlugin.schema.apikey = {}\n apiKeyPlugin.schema.apikey = {\n ...apiKeyPlugin.schema.apikey,\n modelName: betterAuthPluginSlugs.apiKeys,\n fields: {\n ...(plugin.schema?.apikey?.fields ?? {}),\n userId: {\n ...(plugin.schema?.apikey?.fields?.userId ?? {}),\n fieldName: 'user',\n },\n },\n }\n Object.assign(plugin, apiKeyPlugin)\n break\n case supportedBetterAuthPluginIds.passkey:\n const passkeyPlugin = plugin as any\n if (!passkeyPlugin.schema) passkeyPlugin.schema = {}\n if (!passkeyPlugin.schema.passkey) passkeyPlugin.schema.passkey = {}\n passkeyPlugin.schema.passkey = {\n ...passkeyPlugin.schema.passkey,\n modelName: betterAuthPluginSlugs.passkeys,\n fields: {\n ...(passkeyPlugin.schema.passkey.fields || {}),\n userId: {\n ...passkeyPlugin.schema.passkey.fields.userId,\n fieldName: 'user',\n },\n },\n }\n Object.assign(plugin, passkeyPlugin)\n break\n case supportedBetterAuthPluginIds.organization:\n const organizationPlugin = plugin as any\n if (!organizationPlugin.schema) organizationPlugin.schema = {}\n if (!organizationPlugin.schema.organization) organizationPlugin.schema.member = {}\n if (!organizationPlugin.schema.invitation) organizationPlugin.schema.invitation = {}\n if (!organizationPlugin.schema.team) organizationPlugin.schema.team = {}\n if (!organizationPlugin.schema.session) organizationPlugin.schema.session = {}\n organizationPlugin.schema = {\n ...organizationPlugin.schema,\n organization: {\n ...organizationPlugin.schema.organization,\n modelName: betterAuthPluginSlugs.organizations,\n fields: {\n ...(organizationPlugin.schema.organization.fields ?? {}),\n },\n },\n member: {\n ...organizationPlugin.schema.member,\n modelName: betterAuthPluginSlugs.members,\n fields: {\n ...(organizationPlugin.schema.member.fields ?? {}),\n organizationId: {\n ...(organizationPlugin.schema.member.fields?.organizationId ?? {}),\n fieldName: 'organization',\n },\n userId: {\n ...(organizationPlugin.schema.member.fields?.userId ?? {}),\n fieldName: 'user',\n },\n teamId: {\n ...(organizationPlugin.schema.member.fields?.teamId ?? {}),\n fieldName: 'team',\n },\n },\n },\n invitation: {\n ...organizationPlugin.schema.invitation,\n modelName: betterAuthPluginSlugs.invitations,\n fields: {\n ...(organizationPlugin.schema.invitation.fields ?? {}),\n organizationId: {\n ...(organizationPlugin.schema.invitation.fields?.organizationId ?? {}),\n fieldName: 'organization',\n },\n inviterId: {\n ...(organizationPlugin.schema.invitation.fields?.inviterId ?? {}),\n fieldName: 'inviter',\n },\n teamId: {\n ...(organizationPlugin.schema.invitation.fields?.teamId ?? {}),\n fieldName: 'team',\n },\n },\n },\n team: {\n ...organizationPlugin.schema.team,\n modelName: betterAuthPluginSlugs.teams,\n fields: {\n ...(organizationPlugin.schema.team.fields ?? {}),\n organizationId: {\n ...(organizationPlugin.schema.team.fields?.organizationId ?? {}),\n fieldName: 'organization',\n },\n },\n },\n session: {\n ...organizationPlugin.schema.session,\n modelName: baseCollectionSlugs.sessions,\n fields: {\n ...(organizationPlugin.schema.session.fields ?? {}),\n activeOrganizationId: {\n ...(organizationPlugin.schema.session.fields?.activeOrganizationId ?? {}),\n fieldName: 'activeOrganization',\n },\n },\n },\n }\n Object.assign(plugin, organizationPlugin)\n break\n case supportedBetterAuthPluginIds.sso:\n const ssoPlugin = plugin as any\n if (!ssoPlugin.schema) ssoPlugin.schema = {}\n if (!ssoPlugin.schema.sso) ssoPlugin.schema.sso = {}\n ssoPlugin.schema.sso = {\n ...ssoPlugin.schema.sso,\n modelName: betterAuthPluginSlugs.ssoProviders,\n fields: {\n ...(ssoPlugin.schema.sso.fields ?? {}),\n userId: {\n ...(ssoPlugin.schema.sso.fields?.userId ?? {}),\n fieldName: 'user',\n },\n },\n }\n Object.assign(plugin, ssoPlugin)\n break\n case supportedBetterAuthPluginIds.oidc:\n const oidcPlugin = plugin as any\n if (!oidcPlugin.schema) oidcPlugin.schema = {}\n if (!oidcPlugin.schema.oauthApplication) oidcPlugin.schema.oauthApplication = {}\n if (!oidcPlugin.schema.oauthAccessToken) oidcPlugin.schema.oauthAccessToken = {}\n if (!oidcPlugin.schema.oauthConsent) oidcPlugin.schema.oauthConsent = {}\n oidcPlugin.schema = {\n ...oidcPlugin.schema,\n oauthApplication: {\n ...oidcPlugin.schema.oauthApplication,\n modelName: betterAuthPluginSlugs.oauthApplications,\n fields: {\n ...(oidcPlugin.schema.oauthApplication.fields ?? {}),\n userId: {\n ...(oidcPlugin.schema.oauthApplication.fields?.userId ?? {}),\n fieldName: 'user',\n },\n },\n },\n oauthAccessToken: {\n ...oidcPlugin.schema.oauthAccessToken,\n modelName: betterAuthPluginSlugs.oauthAccessTokens,\n fields: {\n ...(oidcPlugin.schema.oauthAccessToken.fields ?? {}),\n userId: {\n ...(oidcPlugin.schema.oauthAccessToken.fields?.userId ?? {}),\n fieldName: 'user',\n },\n clientId: {\n ...(oidcPlugin.schema.oauthAccessToken.fields?.clientId ?? {}),\n fieldName: 'client',\n },\n },\n },\n oauthConsent: {\n ...oidcPlugin.schema.oauthConsent,\n modelName: betterAuthPluginSlugs.oauthConsents,\n fields: {\n ...(oidcPlugin.schema.oauthConsent.fields ?? {}),\n userId: {\n ...(oidcPlugin.schema.oauthConsent.fields?.userId ?? {}),\n fieldName: 'user',\n },\n clientId: {\n ...(oidcPlugin.schema.oauthConsent.fields?.clientId ?? {}),\n fieldName: 'client',\n },\n },\n },\n }\n Object.assign(plugin, oidcPlugin)\n break\n default:\n break\n }\n })\n }\n // Make sure only the supported plugins are used\n Object.assign(res.plugins, supportedPlugins)\n } catch (error) {\n throw new Error(`Error sanitizing BetterAuth plugins: ${error}`)\n }\n }\n\n return res\n}\n"],"names":["supportedBetterAuthPluginIds","betterAuthPluginSlugs","baseCollectionSlugs","ensurePasswordSetBeforeUserCreate","verifyPassword","hashPassword","sanitizeBetterAuthOptions","options","baOptions","betterAuthOptions","userCollectionSlug","users","slug","accountCollectionSlug","accounts","sessionCollectionSlug","sessions","verificationCollectionSlug","verifications","res","user","modelName","account","fields","userId","session","verification","emailAndPassword","enabled","password","verify","hash","Boolean","blockFirstBetterAuthVerificationEmail","originalSendVerificationEmail","emailVerification","sendVerificationEmail","data","request","createdAt","Date","now","getTime","error","console","plugins","supportedPlugins","filter","plugin","Object","values","includes","id","length","warn","p","map","join","forEach","pluginId","admin","adminPlugin","adminRoles","assign","apiKey","apiKeyPlugin","schema","apikey","apiKeys","fieldName","passkey","passkeyPlugin","passkeys","organization","organizationPlugin","member","invitation","team","organizations","members","organizationId","teamId","invitations","inviterId","teams","activeOrganizationId","sso","ssoPlugin","ssoProviders","oidc","oidcPlugin","oauthApplication","oauthAccessToken","oauthConsent","oauthApplications","oauthAccessTokens","clientId","oauthConsents","Error"],"mappings":"AACA,SAASA,4BAA4B,EAAEC,qBAAqB,EAAEC,mBAAmB,QAAQ,WAAU;AACnG,SAASC,iCAAiC,QAAQ,sCAAqC;AACvF,SAASC,cAAc,EAAEC,YAAY,QAAQ,aAAY;AAEzD;;CAEC,GACD,OAAO,SAASC,0BACdC,OAAuC;IAEvC,MAAMC,YAAYD,QAAQE,iBAAiB;IAC3C,MAAMC,qBAAqBH,QAAQI,KAAK,EAAEC,QAAQ;IAClD,MAAMC,wBAAwBN,QAAQO,QAAQ,EAAEF,QAAQ;IACxD,MAAMG,wBAAwBR,QAAQS,QAAQ,EAAEJ,QAAQ;IACxD,MAAMK,6BAA6BV,QAAQW,aAAa,EAAEN,QAAQ;IAElE,MAAMO,MAAkC;QAAE,GAAGX,SAAS;IAAC;IAEvDW,IAAIC,IAAI,GAAG;QACT,GAAIZ,WAAWY,QAAQ,CAAC,CAAC;QACzBC,WAAWX;IACb;IAEAS,IAAIG,OAAO,GAAG;QACZ,GAAId,WAAWc,WAAW,CAAC,CAAC;Q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
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import { adminClient } from 'better-auth/client/plugins';
|
|
5
|
-
import { createAuthClient } from 'better-auth/react';
|
|
6
|
-
import { useParams, usePathname, useRouter } from 'next/navigation';
|
|
7
|
-
import { toast } from 'sonner';
|
|
8
|
-
import { Toaster } from 'sonner';
|
|
9
|
-
import { Button } from '@payloadcms/ui';
|
|
10
|
-
import './styles.css';
|
|
11
|
-
import '@payloadcms/ui/styles.css';
|
|
12
|
-
async function getDocumentData(id, path) {
|
|
13
|
-
const apiUrl = `${path}/api`;
|
|
14
|
-
try {
|
|
15
|
-
// Try to load the /api page and parse the HTML response
|
|
16
|
-
const response = await fetch(apiUrl);
|
|
17
|
-
if (response.ok) {
|
|
18
|
-
const htmlResponse = await response.text();
|
|
19
|
-
// Parse the HTML to extract user data
|
|
20
|
-
try {
|
|
21
|
-
let documentData = null;
|
|
22
|
-
const parser = new DOMParser();
|
|
23
|
-
const doc = parser.parseFromString(htmlResponse, 'text/html');
|
|
24
|
-
// Look for the JSON data in the query inspector
|
|
25
|
-
const jsonRows = doc.querySelectorAll('.query-inspector__row-line');
|
|
26
|
-
if (jsonRows.length > 0) {
|
|
27
|
-
documentData = {};
|
|
28
|
-
jsonRows.forEach((row)=>{
|
|
29
|
-
const keyMatch = row.innerHTML.match(/"([^"]+)"\s*:/);
|
|
30
|
-
if (keyMatch) {
|
|
31
|
-
const key = keyMatch[1].trim();
|
|
32
|
-
const valueElement = row.querySelector('.query-inspector__value');
|
|
33
|
-
if (valueElement) {
|
|
34
|
-
let value = valueElement.textContent?.trim() ?? '';
|
|
35
|
-
// Convert values to appropriate types
|
|
36
|
-
if (value === 'true') value = 'true';
|
|
37
|
-
else if (value === 'false') value = 'false';
|
|
38
|
-
else if (value === 'null') value = 'null';
|
|
39
|
-
else if (!isNaN(Number(value))) value = Number(value).toString();
|
|
40
|
-
else if (value.startsWith('"') && value.endsWith('"')) {
|
|
41
|
-
value = value.substring(1, value.length - 1).trim();
|
|
42
|
-
}
|
|
43
|
-
documentData[key] = value;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return documentData;
|
|
49
|
-
} catch (parseError) {
|
|
50
|
-
console.error('Error parsing document data from HTML:', parseError);
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
} catch (apiError) {
|
|
55
|
-
console.error('Error fetching document data from API:', apiError);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export default function AdminButtons({ userSlug }) {
|
|
59
|
-
const router = useRouter();
|
|
60
|
-
const path = usePathname();
|
|
61
|
-
const params = useParams();
|
|
62
|
-
const [id, setId] = useState('');
|
|
63
|
-
const [documentData, setDocumentData] = useState(null);
|
|
64
|
-
const authClient = createAuthClient({
|
|
65
|
-
plugins: [
|
|
66
|
-
adminClient()
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
useEffect(()=>{
|
|
70
|
-
async function fetchDocumentData() {
|
|
71
|
-
// Get the ID from the params.segments array
|
|
72
|
-
const segments = params.segments;
|
|
73
|
-
const userSlugIndex = segments.findIndex((segment)=>segment === userSlug);
|
|
74
|
-
const id = userSlugIndex !== -1 && userSlugIndex < segments.length - 1 ? segments[userSlugIndex + 1] : segments[segments.length - 1];
|
|
75
|
-
const documentData = await getDocumentData(id, path);
|
|
76
|
-
setId(id);
|
|
77
|
-
setDocumentData(documentData);
|
|
78
|
-
}
|
|
79
|
-
fetchDocumentData();
|
|
80
|
-
}, [
|
|
81
|
-
params,
|
|
82
|
-
path,
|
|
83
|
-
userSlug
|
|
84
|
-
]);
|
|
85
|
-
const handleImpersonate = async ()=>{
|
|
86
|
-
await authClient.admin.impersonateUser({
|
|
87
|
-
userId: id,
|
|
88
|
-
fetchOptions: {
|
|
89
|
-
onSuccess () {
|
|
90
|
-
router.push('/');
|
|
91
|
-
},
|
|
92
|
-
onError (error) {
|
|
93
|
-
console.error('Error impersonating user:', error);
|
|
94
|
-
toast.error('Failed to impersonate user');
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
const handleBan = async ()=>{
|
|
100
|
-
await authClient.admin.banUser({
|
|
101
|
-
userId: id,
|
|
102
|
-
fetchOptions: {
|
|
103
|
-
onSuccess () {
|
|
104
|
-
toast.success('User banned successfully');
|
|
105
|
-
router.refresh();
|
|
106
|
-
},
|
|
107
|
-
onError (error) {
|
|
108
|
-
console.error('Error banning user:', error);
|
|
109
|
-
toast.error('Failed to ban user');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
};
|
|
114
|
-
const handleUnban = async ()=>{
|
|
115
|
-
await authClient.admin.unbanUser({
|
|
116
|
-
userId: id,
|
|
117
|
-
fetchOptions: {
|
|
118
|
-
onSuccess () {
|
|
119
|
-
toast.success('User unbanned successfully');
|
|
120
|
-
router.refresh();
|
|
121
|
-
},
|
|
122
|
-
onError (error) {
|
|
123
|
-
console.error('Error unbanning user:', error);
|
|
124
|
-
toast.error('Failed to unban user');
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
const handleRevokeAllSessions = async ()=>{
|
|
130
|
-
await authClient.admin.revokeUserSessions({
|
|
131
|
-
userId: id,
|
|
132
|
-
fetchOptions: {
|
|
133
|
-
onSuccess () {
|
|
134
|
-
toast.success('All sessions revoked successfully');
|
|
135
|
-
router.refresh();
|
|
136
|
-
},
|
|
137
|
-
onError (error) {
|
|
138
|
-
console.error('Error revoking all sessions:', error);
|
|
139
|
-
toast.error('Failed to revoke all sessions');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
145
|
-
children: [
|
|
146
|
-
/*#__PURE__*/ _jsx("style", {
|
|
147
|
-
children: `
|
|
148
|
-
.admin-actions-container {
|
|
149
|
-
display: flex;
|
|
150
|
-
flex-direction: column;
|
|
151
|
-
}
|
|
152
|
-
.admin-actions-container h3 {
|
|
153
|
-
margin-bottom: 1rem;
|
|
154
|
-
}
|
|
155
|
-
.admin-actions-container .btn {
|
|
156
|
-
margin-block: 0.5rem;
|
|
157
|
-
}
|
|
158
|
-
.ban-button {
|
|
159
|
-
background-color: oklch(0.258 0.092 26.042);
|
|
160
|
-
color: oklch(0.577 0.245 27.325);
|
|
161
|
-
border: 1px solid oklch(0.396 0.141 25.723);
|
|
162
|
-
&:hover {
|
|
163
|
-
color: #fff;
|
|
164
|
-
background-color: oklch(0.505 0.213 27.518);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
.revoke-sessions-button {
|
|
168
|
-
--theme-elevation-800: oklch(0.396 0.141 25.723);
|
|
169
|
-
color: oklch(0.637 0.237 25.331);
|
|
170
|
-
&:hover {
|
|
171
|
-
--theme-elevation-400: oklch(0.396 0.141 25.723);
|
|
172
|
-
color: #fff;
|
|
173
|
-
background-color: oklch(0.396 0.141 25.723);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
`
|
|
177
|
-
}),
|
|
178
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
179
|
-
className: "admin-actions-container",
|
|
180
|
-
children: [
|
|
181
|
-
/*#__PURE__*/ _jsx("h3", {
|
|
182
|
-
children: "Admin Actions"
|
|
183
|
-
}),
|
|
184
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
185
|
-
style: {
|
|
186
|
-
display: 'flex',
|
|
187
|
-
flexWrap: 'wrap',
|
|
188
|
-
columnGap: '0.5rem'
|
|
189
|
-
},
|
|
190
|
-
children: [
|
|
191
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
192
|
-
onClick: handleImpersonate,
|
|
193
|
-
buttonStyle: "primary",
|
|
194
|
-
children: "Impersonate"
|
|
195
|
-
}),
|
|
196
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
197
|
-
onClick: handleRevokeAllSessions,
|
|
198
|
-
buttonStyle: "secondary",
|
|
199
|
-
className: "revoke-sessions-button",
|
|
200
|
-
children: "Revoke All Sessions"
|
|
201
|
-
}),
|
|
202
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
203
|
-
onClick: handleBan,
|
|
204
|
-
buttonStyle: "error",
|
|
205
|
-
className: "ban-button",
|
|
206
|
-
children: "Ban"
|
|
207
|
-
}),
|
|
208
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
209
|
-
onClick: handleUnban,
|
|
210
|
-
buttonStyle: "primary",
|
|
211
|
-
children: "Unban"
|
|
212
|
-
})
|
|
213
|
-
]
|
|
214
|
-
})
|
|
215
|
-
]
|
|
216
|
-
}),
|
|
217
|
-
/*#__PURE__*/ _jsx(Toaster, {})
|
|
218
|
-
]
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
//# sourceMappingURL=admin-buttons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugin/payload/components/admin-buttons.tsx"],"sourcesContent":["'use client'\n\nimport React, { useEffect, useState } from 'react'\nimport { adminClient } from 'better-auth/client/plugins'\nimport { createAuthClient } from 'better-auth/react'\nimport { useParams, usePathname, useRouter } from 'next/navigation'\nimport { toast } from 'sonner'\nimport { Toaster } from 'sonner'\nimport { Button } from '@payloadcms/ui'\nimport './styles.css'\n\nimport '@payloadcms/ui/styles.css'\n\nasync function getDocumentData(id: string, path: string) {\n const apiUrl = `${path}/api`\n try {\n // Try to load the /api page and parse the HTML response\n const response = await fetch(apiUrl)\n if (response.ok) {\n const htmlResponse = await response.text()\n // Parse the HTML to extract user data\n try {\n let documentData: any = null\n const parser = new DOMParser()\n const doc = parser.parseFromString(htmlResponse, 'text/html')\n\n // Look for the JSON data in the query inspector\n const jsonRows = doc.querySelectorAll('.query-inspector__row-line')\n if (jsonRows.length > 0) {\n documentData = {}\n\n jsonRows.forEach((row) => {\n const keyMatch = row.innerHTML.match(/\"([^\"]+)\"\\s*:/)\n if (keyMatch) {\n const key = keyMatch[1].trim()\n const valueElement = row.querySelector('.query-inspector__value')\n if (valueElement) {\n let value = valueElement.textContent?.trim() ?? ''\n\n // Convert values to appropriate types\n if (value === 'true') value = 'true'\n else if (value === 'false') value = 'false'\n else if (value === 'null') value = 'null'\n else if (!isNaN(Number(value))) value = Number(value).toString()\n else if (value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substring(1, value.length - 1).trim()\n }\n\n documentData[key] = value\n }\n }\n })\n }\n\n return documentData\n } catch (parseError) {\n console.error('Error parsing document data from HTML:', parseError)\n return null\n }\n }\n } catch (apiError) {\n console.error('Error fetching document data from API:', apiError)\n }\n}\n\nexport default function AdminButtons({ userSlug }: { userSlug: string }) {\n const router = useRouter()\n const path = usePathname()\n const params = useParams()\n const [id, setId] = useState('')\n const [documentData, setDocumentData] = useState<any>(null)\n\n const authClient = createAuthClient({\n plugins: [adminClient()],\n })\n\n useEffect(() => {\n async function fetchDocumentData() {\n // Get the ID from the params.segments array\n const segments = params.segments as string[]\n const userSlugIndex = segments.findIndex((segment) => segment === userSlug)\n const id =\n userSlugIndex !== -1 && userSlugIndex < segments.length - 1\n ? segments[userSlugIndex + 1]\n : segments[segments.length - 1]\n\n const documentData = await getDocumentData(id, path)\n setId(id)\n setDocumentData(documentData)\n }\n fetchDocumentData()\n }, [params, path, userSlug])\n\n const handleImpersonate = async () => {\n await authClient.admin.impersonateUser({\n userId: id,\n fetchOptions: {\n onSuccess() {\n router.push('/')\n },\n onError(error: any) {\n console.error('Error impersonating user:', error)\n toast.error('Failed to impersonate user')\n },\n },\n })\n }\n\n const handleBan = async () => {\n await authClient.admin.banUser({\n userId: id,\n fetchOptions: {\n onSuccess() {\n toast.success('User banned successfully')\n router.refresh()\n },\n onError(error: any) {\n console.error('Error banning user:', error)\n toast.error('Failed to ban user')\n },\n },\n })\n }\n\n const handleUnban = async () => {\n await authClient.admin.unbanUser({\n userId: id,\n fetchOptions: {\n onSuccess() {\n toast.success('User unbanned successfully')\n router.refresh()\n },\n onError(error: any) {\n console.error('Error unbanning user:', error)\n toast.error('Failed to unban user')\n },\n },\n })\n }\n\n const handleRevokeAllSessions = async () => {\n await authClient.admin.revokeUserSessions({\n userId: id,\n fetchOptions: {\n onSuccess() {\n toast.success('All sessions revoked successfully')\n router.refresh()\n },\n onError(error: any) {\n console.error('Error revoking all sessions:', error)\n toast.error('Failed to revoke all sessions')\n },\n },\n })\n }\n\n return (\n <>\n <style>{`\n .admin-actions-container {\n display: flex;\n flex-direction: column;\n }\n .admin-actions-container h3 {\n margin-bottom: 1rem;\n }\n .admin-actions-container .btn {\n margin-block: 0.5rem;\n }\n .ban-button {\n background-color: oklch(0.258 0.092 26.042);\n color: oklch(0.577 0.245 27.325);\n border: 1px solid oklch(0.396 0.141 25.723);\n &:hover {\n color: #fff;\n background-color: oklch(0.505 0.213 27.518);\n }\n }\n .revoke-sessions-button {\n --theme-elevation-800: oklch(0.396 0.141 25.723);\n color: oklch(0.637 0.237 25.331);\n &:hover {\n --theme-elevation-400: oklch(0.396 0.141 25.723);\n color: #fff;\n background-color: oklch(0.396 0.141 25.723);\n }\n }\n `}</style>\n <div className=\"admin-actions-container\">\n <h3>Admin Actions</h3>\n <div style={{ display: 'flex', flexWrap: 'wrap', columnGap: '0.5rem' }}>\n <Button onClick={handleImpersonate} buttonStyle=\"primary\">\n Impersonate\n </Button>\n <Button\n onClick={handleRevokeAllSessions}\n buttonStyle=\"secondary\"\n className=\"revoke-sessions-button\"\n >\n Revoke All Sessions\n </Button>\n <Button onClick={handleBan} buttonStyle=\"error\" className=\"ban-button\">\n Ban\n </Button>\n <Button onClick={handleUnban} buttonStyle=\"primary\">\n Unban\n </Button>\n </div>\n </div>\n <Toaster />\n </>\n )\n}\n"],"names":["React","useEffect","useState","adminClient","createAuthClient","useParams","usePathname","useRouter","toast","Toaster","Button","getDocumentData","id","path","apiUrl","response","fetch","ok","htmlResponse","text","documentData","parser","DOMParser","doc","parseFromString","jsonRows","querySelectorAll","length","forEach","row","keyMatch","innerHTML","match","key","trim","valueElement","querySelector","value","textContent","isNaN","Number","toString","startsWith","endsWith","substring","parseError","console","error","apiError","AdminButtons","userSlug","router","params","setId","setDocumentData","authClient","plugins","fetchDocumentData","segments","userSlugIndex","findIndex","segment","handleImpersonate","admin","impersonateUser","userId","fetchOptions","onSuccess","push","onError","handleBan","banUser","success","refresh","handleUnban","unbanUser","handleRevokeAllSessions","revokeUserSessions","style","div","className","h3","display","flexWrap","columnGap","onClick","buttonStyle"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAClD,SAASC,WAAW,QAAQ,6BAA4B;AACxD,SAASC,gBAAgB,QAAQ,oBAAmB;AACpD,SAASC,SAAS,EAAEC,WAAW,EAAEC,SAAS,QAAQ,kBAAiB;AACnE,SAASC,KAAK,QAAQ,SAAQ;AAC9B,SAASC,OAAO,QAAQ,SAAQ;AAChC,SAASC,MAAM,QAAQ,iBAAgB;AACvC,OAAO,eAAc;AAErB,OAAO,4BAA2B;AAElC,eAAeC,gBAAgBC,EAAU,EAAEC,IAAY;IACrD,MAAMC,SAAS,GAAGD,KAAK,IAAI,CAAC;IAC5B,IAAI;QACF,wDAAwD;QACxD,MAAME,WAAW,MAAMC,MAAMF;QAC7B,IAAIC,SAASE,EAAE,EAAE;YACf,MAAMC,eAAe,MAAMH,SAASI,IAAI;YACxC,sCAAsC;YACtC,IAAI;gBACF,IAAIC,eAAoB;gBACxB,MAAMC,SAAS,IAAIC;gBACnB,MAAMC,MAAMF,OAAOG,eAAe,CAACN,cAAc;gBAEjD,gDAAgD;gBAChD,MAAMO,WAAWF,IAAIG,gBAAgB,CAAC;gBACtC,IAAID,SAASE,MAAM,GAAG,GAAG;oBACvBP,eAAe,CAAC;oBAEhBK,SAASG,OAAO,CAAC,CAACC;wBAChB,MAAMC,WAAWD,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,SAAQtB,KAAU;oBAChBD,QAAQC,KAAK,CAAC,gCAAgCA;oBAC9CvC,MAAMuC,KAAK,CAAC;gBACd;YACF;QACF;IACF;IAEA,qBACE;;0BACE,KAAC+B;0BAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BT,CAAC;;0BACD,MAACC;gBAAIC,WAAU;;kCACb,KAACC;kCAAG;;kCACJ,MAACF;wBAAID,OAAO;4BAAEI,SAAS;4BAAQC,UAAU;4BAAQC,WAAW;wBAAS;;0CACnE,KAAC1E;gCAAO2E,SAASvB;gCAAmBwB,aAAY;0CAAU;;0CAG1D,KAAC5E;gCACC2E,SAAST;gCACTU,aAAY;gCACZN,WAAU;0CACX;;0CAGD,KAACtE;gCAAO2E,SAASf;gCAAWgB,aAAY;gCAAQN,WAAU;0CAAa;;0CAGvE,KAACtE;gCAAO2E,SAASX;gCAAaY,aAAY;0CAAU;;;;;;0BAKxD,KAAC7E;;;AAGP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LoginRedirect(): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugin/payload/components/login-redirect.tsx"],"sourcesContent":["import { redirect } from 'next/navigation'\n\nexport default function LoginRedirect() {\n redirect('/admin/login')\n}\n"],"names":["redirect","LoginRedirect"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,kBAAiB;AAE1C,eAAe,SAASC;IACtBD,SAAS;AACX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugin/payload/components/logo.tsx"],"sourcesContent":["import React from 'react'\n\nexport default function Logo() {\n return (\n <div className=\"flex items-center justify-center w-full mb-8\">\n <svg\n width=\"60\"\n height=\"45\"\n viewBox=\"0 0 60 45\"\n fill=\"none\"\n className=\"w-5 h-5\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0 0H15V15H30V30H15V45H0V30V15V0ZM45 30V15H30V0H45H60V15V30V45H45H30V30H45Z\"\n className=\"fill-black dark:fill-white\"\n />\n </svg>\n <div className=\"ml-2 font-semibold text-black dark:text-white\">\n Payload <span className=\"text-blue-600 dark:text-blue-400\">×</span> Better Auth\n </div>\n </div>\n )\n}\n"],"names":["React","Logo","div","className","svg","width","height","viewBox","fill","xmlns","path","fillRule","clipRule","d","span"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AAEzB,eAAe,SAASC;IACtB,qBACE,MAACC;QAAIC,WAAU;;0BACb,KAACC;gBACCC,OAAM;gBACNC,QAAO;gBACPC,SAAQ;gBACRC,MAAK;gBACLL,WAAU;gBACVM,OAAM;0BAEN,cAAA,KAACC;oBACCC,UAAS;oBACTC,UAAS;oBACTC,GAAE;oBACFV,WAAU;;;0BAGd,MAACD;gBAAIC,WAAU;;oBAAgD;kCACrD,KAACW;wBAAKX,WAAU;kCAAmC;;oBAAc;;;;;AAIjF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function LogoutButton(): import("react/jsx-runtime").JSX.Element;
|