payload-auth 1.8.0-canary.1 → 1.8.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/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +1 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts.map +1 -1
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +51 -54
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts.map +1 -1
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +4 -4
- package/dist/better-auth/adapter/generate-schema/index.d.ts +1 -1
- package/dist/better-auth/adapter/generate-schema/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/generate-schema/index.js +4 -4
- package/dist/better-auth/adapter/generate-schema/utils.js +4 -4
- package/dist/better-auth/adapter/index.d.ts +2 -2
- package/dist/better-auth/adapter/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/index.js +59 -59
- package/dist/better-auth/adapter/transform/index.d.ts +3 -3
- package/dist/better-auth/adapter/transform/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/transform/index.js +86 -61
- package/dist/better-auth/adapter/types.d.ts +4 -4
- package/dist/better-auth/adapter/types.d.ts.map +1 -1
- package/dist/better-auth/adapter/types.js +1 -1
- package/dist/better-auth/generated-types.d.ts +27 -1
- package/dist/better-auth/generated-types.d.ts.map +1 -1
- package/dist/better-auth/generated-types.js +1 -1
- package/dist/better-auth/index.d.ts +3 -3
- package/dist/better-auth/index.d.ts.map +1 -1
- package/dist/better-auth/index.js +1 -1
- package/dist/better-auth/plugin/constants.d.ts +10 -0
- package/dist/better-auth/plugin/constants.d.ts.map +1 -1
- package/dist/better-auth/plugin/constants.js +163 -153
- package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/check-plugin-exists.js +1 -1
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +7 -7
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-admin-access.js +2 -2
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-all-roles.js +4 -4
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +3 -3
- package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-collection-slug.js +7 -7
- package/dist/better-auth/plugin/helpers/get-collection.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/get-collection.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-collection.js +1 -1
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-ip.js +14 -14
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-signed-cookie.js +13 -13
- package/dist/better-auth/plugin/helpers/index.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/index.js +1 -1
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +2 -2
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts +2 -2
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +1 -1
- package/dist/better-auth/plugin/index.d.ts +7 -11
- package/dist/better-auth/plugin/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/index.js +3 -26
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts +3 -3
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +6 -6
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +19 -20
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +21 -21
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js +26 -26
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/device-code.js +6 -6
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/index.js +10 -4
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/invitations.js +14 -14
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/jwks.js +8 -8
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/members.js +11 -12
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +15 -15
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +16 -16
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +11 -12
- package/dist/better-auth/plugin/lib/build-collections/organization-roles.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/organization-roles.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/organization-roles.js +65 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/organizations.js +61 -13
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js +15 -16
- package/dist/better-auth/plugin/lib/build-collections/rate-limit.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/rate-limit.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/rate-limit.js +54 -0
- package/dist/better-auth/plugin/lib/build-collections/scim-provider.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/scim-provider.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/scim-provider.js +65 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sessions.js +21 -22
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +12 -13
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +17 -18
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/team-members.js +14 -9
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/teams.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/two-factors.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +4 -4
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +5 -5
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +4 -4
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +17 -17
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +7 -7
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +7 -7
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +10 -11
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +9 -9
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +3 -3
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +6 -6
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +12 -12
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/index.js +38 -38
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +3 -3
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +53 -53
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +7 -7
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts +3 -3
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +1 -2
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +12 -12
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +4 -4
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +17 -17
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +2 -2
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/verifications.js +10 -10
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +3 -3
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/get-payload-auth.js +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +4 -4
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +2 -2
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +4 -5
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +11 -11
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +2 -2
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.js +6 -6
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.js +6 -6
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.js +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.js +6 -7
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.js +6 -7
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +3 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +9 -10
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +12 -12
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts +3 -3
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/set-login-methods.js +4 -5
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +20 -20
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.scss +6 -1
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +30 -30
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +6 -2
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts +3 -3
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.js +32 -32
- package/dist/better-auth/plugin/payload/components/login-form/context.d.ts +9 -9
- package/dist/better-auth/plugin/payload/components/login-form/context.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/login-form/context.js +18 -18
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts +3 -3
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.js +32 -32
- package/dist/better-auth/plugin/payload/components/login-form/index.d.ts +4 -3
- package/dist/better-auth/plugin/payload/components/login-form/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/login-form/index.js +3 -3
- package/dist/better-auth/plugin/payload/components/login-form/index.scss +1 -2
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts +1 -1
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/logout-button.js +7 -7
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts +2 -2
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.js +17 -17
- package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts +2 -3
- package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/passkeys/client.js +9 -9
- package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts +4 -4
- package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/passkeys/index.js +4 -4
- package/dist/better-auth/plugin/payload/components/passkeys/index.scss +8 -1
- package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts +3 -3
- package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/passkeys/list.js +12 -12
- package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts +8 -8
- package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/passkeys/types.js +1 -1
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +1 -2
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/rsc-redirect.js +5 -5
- package/dist/better-auth/plugin/payload/components/token-field.d.ts +2 -3
- package/dist/better-auth/plugin/payload/components/token-field.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/token-field.js +5 -6
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js +41 -40
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.scss +6 -3
- package/dist/better-auth/plugin/payload/exports/client.d.ts +6 -7
- package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/exports/client.js +3 -4
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +8 -8
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/exports/rsc.js +5 -5
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +1 -1
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +2 -2
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +10 -11
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +5 -6
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-login/client.js +6 -7
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-login/index.js +21 -21
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +7 -7
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-signup/client.js +29 -29
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js +14 -14
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +3 -4
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/forgot-password/client.js +22 -22
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +7 -7
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js +10 -10
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +4 -4
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/client.js +22 -22
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +7 -7
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/index.js +12 -12
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts +4 -2
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js +17 -17
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +5 -5
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +10 -10
- package/dist/better-auth/plugin/types.d.ts +28 -30
- package/dist/better-auth/plugin/types.d.ts.map +1 -1
- package/dist/better-auth/plugin/types.js +1 -1
- package/dist/better-auth/plugin/utils/set.d.ts.map +1 -1
- package/dist/better-auth/plugin/utils/set.js +4 -4
- package/dist/better-auth/scripts/generate-types.js +58 -61
- package/dist/better-auth/types.d.ts +2 -2
- package/dist/better-auth/types.d.ts.map +1 -1
- package/dist/better-auth/types.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/shared/components/icons.d.ts +2 -3
- package/dist/shared/components/icons.d.ts.map +1 -1
- package/dist/shared/components/icons.js +17 -18
- package/dist/shared/components/logo.d.ts +2 -3
- package/dist/shared/components/logo.d.ts.map +1 -1
- package/dist/shared/components/logo.js +3 -3
- package/dist/shared/form/components/submit.d.ts +1 -1
- package/dist/shared/form/components/submit.d.ts.map +1 -1
- package/dist/shared/form/components/submit.js +2 -2
- package/dist/shared/form/fields/text-field.d.ts.map +1 -1
- package/dist/shared/form/fields/text-field.js +2 -2
- package/dist/shared/form/index.d.ts +13 -19
- package/dist/shared/form/index.d.ts.map +1 -1
- package/dist/shared/form/index.js +4 -4
- package/dist/shared/form/ui/header/index.d.ts +6 -6
- package/dist/shared/form/ui/header/index.d.ts.map +1 -1
- package/dist/shared/form/ui/header/index.js +4 -5
- package/dist/shared/form/ui/header/index.scss +1 -1
- package/dist/shared/form/ui/index.d.ts +26 -23
- package/dist/shared/form/ui/index.d.ts.map +1 -1
- package/dist/shared/form/ui/index.js +33 -20
- package/dist/shared/form/validation.d.ts +1 -1
- package/dist/shared/form/validation.d.ts.map +1 -1
- package/dist/shared/form/validation.js +27 -22
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/payload/fields/field-copy-button/index.css +2 -2
- package/dist/shared/payload/fields/field-copy-button/index.d.ts +2 -2
- package/dist/shared/payload/fields/field-copy-button/index.d.ts.map +1 -1
- package/dist/shared/payload/fields/field-copy-button/index.js +2 -2
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +2 -2
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts.map +1 -1
- package/dist/shared/payload/fields/generate-uuid-button/index.js +2 -2
- package/dist/shared/payload/fields/index.d.ts +2 -2
- package/dist/shared/payload/fields/index.d.ts.map +1 -1
- package/dist/shared/payload/fields/index.js +1 -1
- package/dist/shared/utils/regex.d.ts.map +1 -1
- package/dist/shared/utils/regex.js +1 -1
- package/dist/shared/utils/try-catch.d.ts.map +1 -1
- package/dist/shared/utils/try-catch.js +1 -1
- package/dist/shared/utils/value-or-default.d.ts.map +1 -1
- package/dist/shared/utils/value-or-default.js +2 -2
- package/package.json +28 -27
|
@@ -7,4 +7,4 @@ export function configureSsoPlugin(plugin, resolvedSchemas) {
|
|
|
7
7
|
set(plugin, `schema.${model}.fields.userId.fieldName`, getSchemaFieldName(resolvedSchemas, model, baModelFieldKeys.ssoProvider.userId));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvc3NvLXBsdWdpbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBiYU1vZGVsRmllbGRLZXlzLCBiYU1vZGVsS2V5IH0gZnJvbSBcIkAvYmV0dGVyLWF1dGgvcGx1Z2luL2NvbnN0YW50c1wiO1xuaW1wb3J0IHsgc2V0IH0gZnJvbSBcIkAvYmV0dGVyLWF1dGgvcGx1Z2luL3V0aWxzL3NldFwiO1xuaW1wb3J0IHR5cGUgeyBCZXR0ZXJBdXRoU2NoZW1hcyB9IGZyb20gXCJAL2JldHRlci1hdXRoL3R5cGVzXCI7XG5pbXBvcnQge1xuICBnZXRTY2hlbWFDb2xsZWN0aW9uU2x1ZyxcbiAgZ2V0U2NoZW1hRmllbGROYW1lXG59IGZyb20gXCIuLi9idWlsZC1jb2xsZWN0aW9ucy91dG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2RDLE1BQVcsRUFDWEMsZUFBa0M7SUFFbEMsTUFBTUMsUUFBUVAsV0FBV1EsV0FBVztJQUNwQ1AsSUFDRUksUUFDQSxDQUFDLE9BQU8sRUFBRUUsTUFBTSxVQUFVLENBQUMsRUFDM0JMLHdCQUF3QkksaUJBQWlCQztJQUUzQ04sSUFDRUksUUFDQSxDQUFDLE9BQU8sRUFBRUUsTUFBTSx3QkFBd0IsQ0FBQyxFQUN6Q0osbUJBQ0VHLGlCQUNBQyxPQUNBUixpQkFBaUJTLFdBQVcsQ0FBQ0MsTUFBTTtBQUd6QyJ9
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BetterAuthSchemas } from
|
|
1
|
+
import type { BetterAuthSchemas } from "@/better-auth/types";
|
|
2
2
|
export declare function configureTwoFactorPlugin(plugin: any, resolvedSchemas: BetterAuthSchemas): void;
|
|
3
3
|
//# sourceMappingURL=two-factor-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"two-factor-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"two-factor-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,GAAG,EACX,eAAe,EAAE,iBAAiB,GACjC,IAAI,CAqBN"}
|
|
@@ -8,4 +8,4 @@ export function configureTwoFactorPlugin(plugin, resolvedSchemas) {
|
|
|
8
8
|
set(plugin, `schema.${model}.fields.userId.references.model`, getSchemaCollectionSlug(resolvedSchemas, baModelKey.user));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMapping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ixpQkFBaUJTLFNBQVMsQ0FBQ0MsTUFBTTtJQUdyQ1IsSUFDRUksUUFDQSxDQUFDLE9BQU8sRUFBRUUsTUFBTSwrQkFBK0IsQ0FBQyxFQUNoREwsd0JBQXdCSSxpQkFBaUJOLFdBQVdVLElBQUk7QUFFNUQifQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SanitizedBetterAuthOptions } from
|
|
1
|
+
import type { SanitizedBetterAuthOptions } from "@/better-auth/plugin/types";
|
|
2
2
|
/**
|
|
3
3
|
* Sets up a middleware that converts session.user.role from an a single string seperated by commas back to an array only for /admin routes
|
|
4
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-after-role-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"admin-after-role-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,gBAAgB,EACjB,EAAE;IACD,gBAAgB,EAAE,0BAA0B,CAAC;CAC9C,QAqBA"}
|
|
@@ -2,19 +2,19 @@ import { createAuthMiddleware, getSessionFromCtx } from "better-auth/api";
|
|
|
2
2
|
/**
|
|
3
3
|
* Sets up a middleware that converts session.user.role from an a single string seperated by commas back to an array only for /admin routes
|
|
4
4
|
*/ export function adminAfterRoleMiddleware({ sanitizedOptions }) {
|
|
5
|
-
if (typeof sanitizedOptions.hooks !==
|
|
5
|
+
if (typeof sanitizedOptions.hooks !== "object") sanitizedOptions.hooks = {};
|
|
6
6
|
const originalAfter = sanitizedOptions.hooks.after;
|
|
7
7
|
sanitizedOptions.hooks.after = createAuthMiddleware(async (ctx)=>{
|
|
8
|
-
if (ctx.path.startsWith(
|
|
8
|
+
if (ctx.path.startsWith("/admin")) {
|
|
9
9
|
await getSessionFromCtx(ctx);
|
|
10
|
-
if (ctx.context.session && ctx.context.session.user && typeof ctx.context.session.user.role ===
|
|
11
|
-
ctx.context.session.user.role = ctx.context.session.user.role.split(
|
|
10
|
+
if (ctx.context.session && ctx.context.session.user && typeof ctx.context.session.user.role === "string") {
|
|
11
|
+
ctx.context.session.user.role = ctx.context.session.user.role.split(",").map((r)=>r.trim()).filter(Boolean);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
if (typeof originalAfter ===
|
|
14
|
+
if (typeof originalAfter === "function") {
|
|
15
15
|
originalAfter(ctx);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvdXRpbHMvYWRtaW4tYWZ0ZXItcm9sZS1taWRkbGV3YXJlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNyZWF0ZUF1dGhNaWRkbGV3YXJlLCBnZXRTZXNzaW9uRnJvbUN0eCB9IGZyb20gXCJiZXR0ZXItYXV0aC9hcGlcIjtcbmltcG9ydCB0eXBlIHsgU2FuaXRpemVkQmV0dGVyQXV0aE9wdGlvbnMgfSBmcm9tIFwiQC9iZXR0ZXItYXV0aC9wbHVnaW4vdHlwZXNcIjtcblxuLyoqXG4gKiBTZXRzIHVwIGEgbWlkZGxld2FyZSB0aGF0IGNvbnZlcnRzIHNlc3Npb24udXNlci5yb2xlIGZyb20gYW4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JQUFJLENBQUNDLElBQUksS0FBSyxVQUN6QztnQkFDQU4sSUFBSUcsT0FBTyxDQUFDQyxPQUFPLENBQUVDLElBQUksQ0FBQ0MsSUFBSSxHQUFHTixJQUFJRyxPQUFPLENBQUNDLE9BQU8sQ0FBQ0MsSUFBSSxDQUFDQyxJQUFJLENBQzNEQyxLQUFLLENBQUMsS0FDTkMsR0FBRyxDQUFDLENBQUNDLElBQWNBLEVBQUVDLElBQUksSUFDekJDLE1BQU0sQ0FBQ0M7WUFDWjtRQUNGO1FBQ0EsSUFBSSxPQUFPZCxrQkFBa0IsWUFBWTtZQUN2Q0EsY0FBY0U7UUFDaEI7SUFDRjtBQUNGIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SanitizedBetterAuthOptions } from
|
|
1
|
+
import type { SanitizedBetterAuthOptions } from "@/better-auth/plugin/types";
|
|
2
2
|
/**
|
|
3
3
|
* Sets up a middleware that converts session.user.role from an array to a single string seperated by commas. only for /admin routes
|
|
4
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-before-role-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"admin-before-role-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,gBAAgB,EACjB,EAAE;IACD,gBAAgB,EAAE,0BAA0B,CAAC;CAC9C,QAmBA"}
|
|
@@ -2,19 +2,19 @@ import { createAuthMiddleware, getSessionFromCtx } from "better-auth/api";
|
|
|
2
2
|
/**
|
|
3
3
|
* Sets up a middleware that converts session.user.role from an array to a single string seperated by commas. only for /admin routes
|
|
4
4
|
*/ export function adminBeforeRoleMiddleware({ sanitizedOptions }) {
|
|
5
|
-
if (typeof sanitizedOptions.hooks !==
|
|
5
|
+
if (typeof sanitizedOptions.hooks !== "object") sanitizedOptions.hooks = {};
|
|
6
6
|
const originalBefore = sanitizedOptions.hooks.before;
|
|
7
7
|
sanitizedOptions.hooks.before = createAuthMiddleware(async (ctx)=>{
|
|
8
|
-
if (ctx.path.startsWith(
|
|
8
|
+
if (ctx.path.startsWith("/admin")) {
|
|
9
9
|
await getSessionFromCtx(ctx);
|
|
10
10
|
if (ctx.context.session && ctx.context.session.user && Array.isArray(ctx.context.session.user.role)) {
|
|
11
|
-
ctx.context.session.user.role = ctx.context.session.user.role.join(
|
|
11
|
+
ctx.context.session.user.role = ctx.context.session.user.role.join(",");
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
if (typeof originalBefore ===
|
|
15
|
-
originalBefore(ctx);
|
|
14
|
+
if (typeof originalBefore === "function") {
|
|
15
|
+
return originalBefore(ctx);
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvdXRpbHMvYWRtaW4tYmVmb3JlLXJvbGUtbWlkZGxld2FyZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVBdXRoTWlkZGxld2FyZSwgZ2V0U2Vzc2lvbkZyb21DdHggfSBmcm9tIFwiYmV0dGVyLWF1dGgvYXBpXCI7XG5pbXBvcnQgdHlwZSB7IFNhbml0aXplZEJldHRlckF1dGhP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FPLENBQUNQLElBQUlHLE9BQU8sQ0FBQ0MsT0FBTyxDQUFDQyxJQUFJLENBQUNHLElBQUksR0FDM0M7Z0JBQ0FSLElBQUlHLE9BQU8sQ0FBQ0MsT0FBTyxDQUFFQyxJQUFJLENBQUNHLElBQUksR0FDNUJSLElBQUlHLE9BQU8sQ0FBQ0MsT0FBTyxDQUFDQyxJQUFJLENBQUNHLElBQUksQ0FBQ0MsSUFBSSxDQUFDO1lBQ3ZDO1FBQ0Y7UUFDQSxJQUFJLE9BQU9YLG1CQUFtQixZQUFZO1lBQ3hDLE9BQU9BLGVBQWVFO1FBQ3hCO0lBQ0Y7QUFDRiJ9
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { baModelKey } from
|
|
2
|
-
import type { BetterAuthSchemas, SanitizedBetterAuthOptions } from
|
|
3
|
-
import type { CollectionConfig } from
|
|
1
|
+
import { baModelKey } from "@/better-auth/plugin/constants";
|
|
2
|
+
import type { BetterAuthSchemas, SanitizedBetterAuthOptions } from "@/better-auth/plugin/types";
|
|
3
|
+
import type { CollectionConfig } from "payload";
|
|
4
4
|
/**
|
|
5
5
|
* Mirrors Payload's `saveToJWT: false` flags into BetterAuth `additionalFields.returned: false`
|
|
6
6
|
* so cookie cache output respects collection config even if BetterAuth hooks don't run.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-save-to-jwt-returned.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"apply-save-to-jwt-returned.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,QAAQ,EACT,EAAE;IACD,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,eAAe,EAAE,iBAAiB,CAAC;IACnC,QAAQ,EAAE,OAAO,UAAU,CAAC,IAAI,GAAG,OAAO,UAAU,CAAC,OAAO,CAAC;CAC9D,QAiCA"}
|
package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getSchemaCollectionSlug } from "../../build-collections/utils/collection-schema";
|
|
2
1
|
import { flattenAllFields } from "payload";
|
|
2
|
+
import { getSchemaCollectionSlug } from "../../build-collections/utils/collection-schema";
|
|
3
3
|
/**
|
|
4
4
|
* Mirrors Payload's `saveToJWT: false` flags into BetterAuth `additionalFields.returned: false`
|
|
5
5
|
* so cookie cache output respects collection config even if BetterAuth hooks don't run.
|
|
@@ -18,7 +18,7 @@ import { flattenAllFields } from "payload";
|
|
|
18
18
|
};
|
|
19
19
|
flattened.forEach((field)=>{
|
|
20
20
|
const saveToJWT = field.saveToJWT;
|
|
21
|
-
const isJoin = field.type ===
|
|
21
|
+
const isJoin = field.type === "join";
|
|
22
22
|
// Default Payload behavior: only fields with saveToJWT === true are included in JWT.
|
|
23
23
|
// For BetterAuth cookie cache, explicitly mark joins and saveToJWT false as non-returned.
|
|
24
24
|
if (saveToJWT === false || isJoin && saveToJWT !== true) {
|
|
@@ -35,4 +35,4 @@ import { flattenAllFields } from "payload";
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
38
|
+
//# sourceMapping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0JBQWdCLElBQUksQ0FBQztJQUNwRSxNQUFNQywwQkFBK0M7UUFDbkQsR0FBR0Ysd0JBQXdCO0lBQzdCO0lBRUFKLFVBQVVPLE9BQU8sQ0FBQyxDQUFDQztRQUNqQixNQUFNQyxZQUFZLEFBQUNELE1BQWNDLFNBQVM7UUFDMUMsTUFBTUMsU0FBUyxBQUFDRixNQUFjRyxJQUFJLEtBQUs7UUFFdkMscUZBQXFGO1FBQ3JGLDBGQUEwRjtRQUMxRixJQUFJRixjQUFjLFNBQVVDLFVBQVVELGNBQWMsTUFBTztZQUN6RCxNQUFNRyxxQkFDSixBQUFDSixNQUFjSyxNQUFNLEVBQUVELHNCQUFzQkosTUFBTU0sSUFBSTtZQUN6RFIsdUJBQXVCLENBQUNNLG1CQUFtQixHQUFHO2dCQUM1QyxHQUFHTix1QkFBdUIsQ0FBQ00sbUJBQW1CO2dCQUM5Q0csVUFBVTtZQUNaO1FBQ0Y7SUFDRjtJQUVDeEIsaUJBQXlCLENBQUNXLFVBQVUsR0FBRztRQUN0QyxHQUFHQyxhQUFhO1FBQ2hCRSxrQkFBa0JDO0lBQ3BCO0FBQ0YifQ==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SanitizedBetterAuthOptions } from
|
|
1
|
+
import type { SanitizedBetterAuthOptions } from "@/better-auth/plugin/types";
|
|
2
2
|
/**
|
|
3
3
|
* Adds a before hook to the user create operation to ensure the password is set.
|
|
4
4
|
* This is necessary because the password is not set in the user create operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-password-set-before-create.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"ensure-password-set-before-create.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,0BAA0B,QAwBpC"}
|
|
@@ -3,16 +3,15 @@
|
|
|
3
3
|
* This is necessary because the password is not set in the user create operation
|
|
4
4
|
* and is instead set in the sync password accounts hook.
|
|
5
5
|
*/ export function ensurePasswordSetBeforeUserCreate(options) {
|
|
6
|
-
if (typeof options.databaseHooks !==
|
|
7
|
-
if (typeof options.databaseHooks.user !==
|
|
8
|
-
if (typeof options.databaseHooks.user.create !==
|
|
6
|
+
if (typeof options.databaseHooks !== "object") options.databaseHooks = {};
|
|
7
|
+
if (typeof options.databaseHooks.user !== "object") options.databaseHooks.user = {};
|
|
8
|
+
if (typeof options.databaseHooks.user.create !== "object") options.databaseHooks.user.create = {};
|
|
9
9
|
const initialBeforeUserCreateHook = options.databaseHooks.user.create.before ?? null;
|
|
10
10
|
options.databaseHooks.user.create.before = async (user, ctx)=>{
|
|
11
11
|
if (!user.password) {
|
|
12
|
-
;
|
|
13
|
-
user.password = ctx?.body?.password ?? Array(3).fill(0).map(()=>Math.random().toString(36).slice(2)).join('');
|
|
12
|
+
user.password = ctx?.body?.password ?? Array(3).fill(0).map(()=>Math.random().toString(36).slice(2)).join("");
|
|
14
13
|
}
|
|
15
|
-
if (typeof initialBeforeUserCreateHook ===
|
|
14
|
+
if (typeof initialBeforeUserCreateHook === "function") {
|
|
16
15
|
return initialBeforeUserCreateHook(user, ctx);
|
|
17
16
|
}
|
|
18
17
|
return {
|
|
@@ -21,4 +20,4 @@
|
|
|
21
20
|
};
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Ny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NBQVNBLGtDQUNkQyxPQUFtQztJQUVuQyxJQUFJLE9BQU9BLFFBQVFDLGFBQWEsS0FBSyxVQUFVRCxRQUFRQyxhQUFhLEdBQUcsQ0FBQztJQUN4RSxJQUFJLE9BQU9ELFFBQVFDLGFBQWEsQ0FBQ0MsSUFBSSxLQUFLLFVBQ3hDRixRQUFRQyxhQUFhLENBQUNDLElBQUksR0FBRyxDQUFDO0lBQ2hDLElBQUksT0FBT0YsUUFBUUMsYUFBYSxDQUFDQyxJQUFJLENBQUNDLE1BQU0sS0FBSyxVQUMvQ0gsUUFBUUMsYUFBYSxDQUFDQyxJQUFJLENBQUNDLE1BQU0sR0FBRyxDQUFDO0lBQ3ZDLE1BQU1DLDhCQUNKSixRQUFRQyxhQUFhLENBQUNDLElBQUksQ0FBQ0MsTUFBTSxDQUFDRSxNQUFNLElBQUk7SUFFOUNMLFFBQVFDLGFBQWEsQ0FBQ0MsSUFBSSxDQUFDQyxNQUFNLENBQUNFLE1BQU0sR0FBRyxPQUFPSCxNQUFNSTtRQUN0RCxJQUFJLENBQUMsQUFBQ0osS0FBYUssUUFBUSxFQUFFO1lBQzFCTCxLQUFhSyxRQUFRLEdBQ3BCRCxLQUFLRSxNQUFNRCxZQUNYRSxNQUFNLEdBQ0hDLElBQUksQ0FBQyxHQUNMQyxHQUFHLENBQUMsSUFBTUMsS0FBS0MsTUFBTSxHQUFHQyxRQUFRLENBQUMsSUFBSUMsS0FBSyxDQUFDLElBQzNDQyxJQUFJLENBQUM7UUFDWjtRQUNBLElBQUksT0FBT1osZ0NBQWdDLFlBQVk7WUFDckQsT0FBT0EsNEJBQTRCRixNQUFNSTtRQUMzQztRQUNBLE9BQU87WUFBRVcsTUFBTWY7UUFBSztJQUN0QjtBQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"password.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.ts"],"names":[],"mappings":"AA2BA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,CAQnE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAU,0BAIlC;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,KAAG,OAAO,CAAC,OAAO,CAyBlB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import crypto from "crypto";
|
|
|
5
5
|
* This generates a hash compatible with Payload's internal auth system
|
|
6
6
|
* so that passwords set via better-auth can be used with Payload admin panel
|
|
7
7
|
*/ function pbkdf2Promisified(password, salt) {
|
|
8
|
-
return new Promise((resolve, reject)=>crypto.pbkdf2(password, salt, 25000, 512,
|
|
8
|
+
return new Promise((resolve, reject)=>crypto.pbkdf2(password, salt, 25000, 512, "sha256", (err, hashRaw)=>err ? reject(err) : resolve(hashRaw)));
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Generates random bytes for the salt
|
|
@@ -22,9 +22,9 @@ import crypto from "crypto";
|
|
|
22
22
|
* @returns A string in the format {salt}:{hash}
|
|
23
23
|
*/ export const hashPassword = async (password)=>{
|
|
24
24
|
const saltBuffer = await randomBytes();
|
|
25
|
-
const salt = saltBuffer.toString(
|
|
25
|
+
const salt = saltBuffer.toString("hex");
|
|
26
26
|
const hashRaw = await pbkdf2Promisified(password, salt);
|
|
27
|
-
const hash = hashRaw.toString(
|
|
27
|
+
const hash = hashRaw.toString("hex");
|
|
28
28
|
return `${salt}:${hash}`;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
@@ -45,19 +45,18 @@ import crypto from "crypto";
|
|
|
45
45
|
storedHash = hash;
|
|
46
46
|
} else {
|
|
47
47
|
// Otherwise, split the combined format (from account.password)
|
|
48
|
-
const parts = hash.split(
|
|
48
|
+
const parts = hash.split(":");
|
|
49
49
|
if (parts.length !== 2) {
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
|
-
;
|
|
53
52
|
[saltValue, storedHash] = parts;
|
|
54
53
|
}
|
|
55
54
|
if (!saltValue || !storedHash) {
|
|
56
55
|
return false;
|
|
57
56
|
}
|
|
58
57
|
const hashRaw = await pbkdf2Promisified(password, saltValue);
|
|
59
|
-
const computedHash = hashRaw.toString(
|
|
58
|
+
const computedHash = hashRaw.toString("hex");
|
|
60
59
|
return storedHash === computedHash;
|
|
61
60
|
};
|
|
62
61
|
|
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvdXRpbHMvcGFzc3dvcmQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGNyeXB0byBmcm9tIFwiY3J5cHRvXCI7XG5cbi8qKlxuICogTWltaWNzIFBheWxvYWQncyBpbnRlcm5hbCBwYXNzd29yZCBoYXNoaW5nIHVzaW5nIHBia2RmMlxuICpcbiAqIFRoaXMgZ2VuZXJhdGVzIGEgaGFzaCBjb21wYXRpYmxlIHdpdGggUGF5bG9hZCdzIGludGVybmFsIGF1dGggc3lzdGVtXG4gKiBzbyB0aGF0IHBhc3N3b3JkcyBzZXQgdmlhIGJldHRlci1hdXRoIGNhbiBiZSB1c2VkIHdpdGggUGF5bG9hZCBhZG1pbiBwYW5lbFxuICovXG5mdW5jdGlvbiBwYmtkZjJQcm9taXNpZmllZChwYXNzd29yZDogc3RyaW5nLCBzYWx0OiBzdHJpbmcpOiBQcm9taXNlPEJ1ZmZlcj4ge1xuICByZXR1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sK0RBQStEO1FBQy9ELE1BQU1JLFFBQVFKLEtBQUtLLEtBQUssQ0FBQztRQUN6QixJQUFJRCxNQUFNRSxNQUFNLEtBQUssR0FBRztZQUN0QixPQUFPO1FBQ1Q7UUFDQSxDQUFDSixXQUFXQyxXQUFXLEdBQUdDO0lBQzVCO0lBRUEsSUFBSSxDQUFDRixhQUFhLENBQUNDLFlBQVk7UUFDN0IsT0FBTztJQUNUO0lBRUEsTUFBTVIsVUFBVSxNQUFNUixrQkFBa0JDLFVBQVVjO0lBQ2xELE1BQU1LLGVBQWVaLFFBQVFJLFFBQVEsQ0FBQztJQUV0QyxPQUFPSSxlQUFlSTtBQUN4QixFQUFFIn0=
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { SanitizedBetterAuthOptions } from "@/better-auth/plugin/types";
|
|
2
|
+
import { PayloadAuthOptions } from "@/better-auth/types";
|
|
3
3
|
/**
|
|
4
4
|
* Mofies options object and adds a middleware to check for admin invite for sign up
|
|
5
5
|
*/
|
|
6
6
|
export declare const requireAdminInviteForSignUpMiddleware: ({ options, pluginOptions }: {
|
|
7
7
|
options: SanitizedBetterAuthOptions;
|
|
8
|
-
pluginOptions:
|
|
8
|
+
pluginOptions: PayloadAuthOptions;
|
|
9
9
|
}) => Promise<void>;
|
|
10
10
|
//# sourceMappingURL=require-admin-invite-for-sign-up-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-admin-invite-for-sign-up-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"require-admin-invite-for-sign-up-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAQzD;;GAEG;AACH,eAAO,MAAM,qCAAqC,GAAU,4BAGzD;IACD,OAAO,EAAE,0BAA0B,CAAC;IACpC,aAAa,EAAE,kBAAkB,CAAC;CACnC,kBAiCA,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createAuthMiddleware } from "better-auth/api";
|
|
3
|
-
import { APIError } from "better-auth/api";
|
|
1
|
+
import { APIError, createAuthMiddleware } from "better-auth/api";
|
|
4
2
|
import { z } from "zod";
|
|
3
|
+
import { baseSlugs } from "../../../constants";
|
|
5
4
|
const throwUnauthorizedError = ()=>{
|
|
6
|
-
throw new APIError(
|
|
7
|
-
message:
|
|
5
|
+
throw new APIError("UNAUTHORIZED", {
|
|
6
|
+
message: "signup disabled" // mimic: https://github.com/better-auth/better-auth/blob/171fab5273cf38f46cf207b0d99c8ccdda64c2fb/packages/better-auth/src/oauth2/link-account.ts#L108
|
|
8
7
|
});
|
|
9
8
|
};
|
|
10
9
|
/**
|
|
@@ -13,8 +12,8 @@ const throwUnauthorizedError = ()=>{
|
|
|
13
12
|
options.hooks = options.hooks || {};
|
|
14
13
|
const originalBefore = options.hooks.before;
|
|
15
14
|
options.hooks.before = createAuthMiddleware(async (ctx)=>{
|
|
16
|
-
if (ctx.path !==
|
|
17
|
-
!(ctx.path ===
|
|
15
|
+
if (ctx.path !== "/sign-up/email" && // not an email sign-up request
|
|
16
|
+
!(ctx.path === "/sign-in/social" && ctx.body?.requestSignUp // not a social sign-in request with sign-up intent
|
|
18
17
|
)) return;
|
|
19
18
|
const adminInviteToken = ctx?.query?.adminInviteToken ?? ctx.body.adminInviteToken;
|
|
20
19
|
if (!!pluginOptions.requireAdminInviteForSignUp && !z.string().uuid().safeParse(adminInviteToken).success) {
|
|
@@ -22,9 +21,9 @@ const throwUnauthorizedError = ()=>{
|
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
23
|
const query = {
|
|
25
|
-
field:
|
|
24
|
+
field: "token",
|
|
26
25
|
value: adminInviteToken,
|
|
27
|
-
operator:
|
|
26
|
+
operator: "eq"
|
|
28
27
|
};
|
|
29
28
|
const isValidAdminInvitation = await ctx.context.adapter.count({
|
|
30
29
|
model: pluginOptions.adminInvitations?.slug ?? baseSlugs.adminInvitations,
|
|
@@ -40,4 +39,4 @@ const throwUnauthorizedError = ()=>{
|
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvdXRpbHMvcmVxdWlyZS1hZG1pbi1pbnZpdGUtZm9yLXNpZ24tdXAtbWlkZGxld2FyZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFdoZXJlIH0gZnJvbSBcImJldHRlci1hdXRoXCI7XG5pbXBvcnQgeyBBUElFcnJvciwgY3JlYXRlQXV0aE1pZGRsZXdhcmUgfSBmcm9tIFwiYmV0dGVyLWF1dGgvYXBpXCI7XG5pbXBvcnQgeyB6IH0gZnJvbSBcInpvZFwiO1xuaW1wb3J0IHsgYmFzZVNsdWdzIH0gZnJvbSBcIkAvYmV0dGVyLWF1dGgvcGx1Z2luL2NvbnN0YW50c1wiO1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gXCJAL2JldHRlci1hdXRoL3BsdWdpbi90eXBlc1wiO1xuaW1wb3J0IHsgUGF5bG9hZEF1dGhPcHRpb25zIH0gZnJvbSBcIkAvYmV0dGVyLWF1dGgvdHlwZX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["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-admin-invite-after-email-sign-up-middleware.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,wCAAwC,GAAU,gEAI5D;IACD,OAAO,EAAE,0BAA0B,CAAC;IACpC,6BAA6B,EAAE,MAAM,CAAC;IACtC,kBAAkB,EAAE,MAAM,CAAC;CAC5B,kBA8DA,CAAC"}
|
|
@@ -7,8 +7,8 @@ import { createAuthMiddleware } from "better-auth/api";
|
|
|
7
7
|
options.hooks.after = createAuthMiddleware(async (ctx)=>{
|
|
8
8
|
const adapter = ctx.context.adapter;
|
|
9
9
|
const internalAdapter = ctx.context.internalAdapter;
|
|
10
|
-
if (ctx.path !==
|
|
11
|
-
if (typeof originalAfter ===
|
|
10
|
+
if (ctx.path !== "/sign-up/email") {
|
|
11
|
+
if (typeof originalAfter === "function") originalAfter(ctx);
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
const email = ctx.body.email;
|
|
@@ -17,28 +17,28 @@ import { createAuthMiddleware } from "better-auth/api";
|
|
|
17
17
|
model: adminInvitationCollectionSlug,
|
|
18
18
|
where: [
|
|
19
19
|
{
|
|
20
|
-
field:
|
|
20
|
+
field: "token",
|
|
21
21
|
value: adminInviteToken,
|
|
22
|
-
operator:
|
|
22
|
+
operator: "eq"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
});
|
|
26
26
|
if (!adminInvitation || !adminInvitation?.role || !email) {
|
|
27
|
-
if (typeof originalAfter ===
|
|
27
|
+
if (typeof originalAfter === "function") originalAfter(ctx);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
const newlyCreatedUser = await internalAdapter.findUserByEmail(email);
|
|
31
31
|
if (!newlyCreatedUser) {
|
|
32
|
-
if (typeof originalAfter ===
|
|
32
|
+
if (typeof originalAfter === "function") originalAfter(ctx);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
await adapter.update({
|
|
36
36
|
model: userCollectionSlug,
|
|
37
37
|
where: [
|
|
38
38
|
{
|
|
39
|
-
field:
|
|
39
|
+
field: "id",
|
|
40
40
|
value: newlyCreatedUser.user.id,
|
|
41
|
-
operator:
|
|
41
|
+
operator: "eq"
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
update: {
|
|
@@ -49,14 +49,14 @@ import { createAuthMiddleware } from "better-auth/api";
|
|
|
49
49
|
model: adminInvitationCollectionSlug,
|
|
50
50
|
where: [
|
|
51
51
|
{
|
|
52
|
-
field:
|
|
52
|
+
field: "id",
|
|
53
53
|
value: adminInvitation.id,
|
|
54
|
-
operator:
|
|
54
|
+
operator: "eq"
|
|
55
55
|
}
|
|
56
56
|
]
|
|
57
57
|
});
|
|
58
|
-
if (typeof originalAfter ===
|
|
58
|
+
if (typeof originalAfter === "function") originalAfter(ctx);
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
62
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL3Nhbml0aXplLWJldHRlci1hdXRoLW9wdGlvbnMvdXRpbHMvdXNlLWFkbWluLWludml0ZS1hZnRlci1lbWFpbC1zaWduLXVwLW1pZGRsZXdhcmUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3JlYXRlQXV0aE1pZGRsZXdhcmUgfSBmcm9tIFwiYmV0dGVyLWF1dGgvYXBpXCI7XG5pbXBvcnQgdH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DQUFDWCxPQUFPO1lBQ3hELElBQUksT0FBT1Asa0JBQWtCLFlBQVlBLGNBQWNFO1lBQ3ZEO1FBQ0Y7UUFFQSxNQUFNaUIsbUJBQW1CLE1BQU1kLGdCQUFnQmUsZUFBZSxDQUFDYjtRQUMvRCxJQUFJLENBQUNZLGtCQUFrQjtZQUNyQixJQUFJLE9BQU9uQixrQkFBa0IsWUFBWUEsY0FBY0U7WUFDdkQ7UUFDRjtRQUVBLE1BQU1DLFFBQVFrQixNQUFNLENBQUM7WUFDbkJSLE9BQU9mO1lBQ1BnQixPQUFPO2dCQUNMO29CQUNFQyxPQUFPO29CQUNQQyxPQUFPRyxpQkFBaUJHLElBQUksQ0FBQ0MsRUFBRTtvQkFDL0JOLFVBQVU7Z0JBQ1o7YUFDRDtZQUNESSxRQUFRO2dCQUNOSCxNQUFNUCxpQkFBaUJPO1lBQ3pCO1FBQ0Y7UUFFQSxNQUFNZixRQUFRcUIsTUFBTSxDQUFDO1lBQ25CWCxPQUFPaEI7WUFDUGlCLE9BQU87Z0JBQ0w7b0JBQ0VDLE9BQU87b0JBQ1BDLE9BQU9MLGdCQUFnQlksRUFBRTtvQkFDekJOLFVBQVU7Z0JBQ1o7YUFDRDtRQUNIO1FBRUEsSUFBSSxPQUFPakIsa0JBQWtCLFlBQVlBLGNBQWNFO0lBQ3pEO0FBQ0YsRUFBRSJ9
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PayloadAuthOptions } from "../types";
|
|
2
2
|
export declare function setLoginMethods({ pluginOptions }: {
|
|
3
|
-
pluginOptions:
|
|
4
|
-
}):
|
|
3
|
+
pluginOptions: PayloadAuthOptions;
|
|
4
|
+
}): PayloadAuthOptions;
|
|
5
5
|
//# sourceMappingURL=set-login-methods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-login-methods.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/lib/set-login-methods.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"set-login-methods.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/lib/set-login-methods.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACd,EAAE;IACD,aAAa,EAAE,kBAAkB,CAAC;CACnC,sBAcA"}
|
|
@@ -2,14 +2,13 @@ import { supportedBAPluginIds } from "../constants";
|
|
|
2
2
|
import { checkPluginExists } from "../helpers/check-plugin-exists";
|
|
3
3
|
export function setLoginMethods({ pluginOptions }) {
|
|
4
4
|
const betterAuthOptions = pluginOptions.betterAuthOptions ?? {};
|
|
5
|
-
if (pluginOptions?.admin?.loginMethods) return pluginOptions // If user defined, exit early
|
|
6
|
-
;
|
|
5
|
+
if (pluginOptions?.admin?.loginMethods) return pluginOptions; // If user defined, exit early
|
|
7
6
|
const loginMethods = Object.keys(betterAuthOptions?.socialProviders ?? {});
|
|
8
|
-
if (!!betterAuthOptions?.emailAndPassword || betterAuthOptions?.emailAndPassword?.enabled) loginMethods.push(
|
|
9
|
-
if (checkPluginExists(betterAuthOptions, supportedBAPluginIds.passkey)) loginMethods.push(
|
|
7
|
+
if (!!betterAuthOptions?.emailAndPassword || betterAuthOptions?.emailAndPassword?.enabled) loginMethods.push("emailPassword");
|
|
8
|
+
if (checkPluginExists(betterAuthOptions, supportedBAPluginIds.passkey)) loginMethods.push("passkey");
|
|
10
9
|
pluginOptions.admin = pluginOptions.admin ?? {};
|
|
11
10
|
pluginOptions.admin.loginMethods = loginMethods;
|
|
12
11
|
return pluginOptions;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vb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sSUFBSSxDQUFDO0lBQ3BCVCxjQUFjRSxLQUFLLEdBQUdGLGNBQWNFLEtBQUssSUFBSSxDQUFDO0lBQzlDRixjQUFjRSxLQUFLLENBQUNDLFlBQVksR0FBR0E7SUFDbkMsT0FBT0g7QUFDVCJ9
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.scss";
|
|
3
|
+
interface AdminButtonsProps {
|
|
4
4
|
userSlug: string;
|
|
5
5
|
baseURL?: string;
|
|
6
6
|
basePath?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare
|
|
7
|
+
}
|
|
8
|
+
export declare function AdminButtons({ baseURL, basePath }: AdminButtonsProps): React.JSX.Element | null;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|