@luochuanyuewu/payload-auth 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 +24 -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 +317 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +2 -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 +23 -0
- package/dist/better-auth/adapter/generate-schema/index.d.ts +5 -0
- package/dist/better-auth/adapter/generate-schema/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/index.js +19 -0
- package/dist/better-auth/adapter/generate-schema/utils.d.ts +3 -0
- package/dist/better-auth/adapter/generate-schema/utils.d.ts.map +1 -0
- package/dist/better-auth/adapter/generate-schema/utils.js +20 -0
- package/dist/better-auth/adapter/index.d.ts +16 -0
- package/dist/better-auth/adapter/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/index.js +717 -0
- package/dist/better-auth/adapter/transform/index.d.ts +31 -0
- package/dist/better-auth/adapter/transform/index.d.ts.map +1 -0
- package/dist/better-auth/adapter/transform/index.js +729 -0
- package/dist/better-auth/adapter/types.d.ts +11 -0
- package/dist/better-auth/adapter/types.d.ts.map +1 -0
- package/dist/better-auth/adapter/types.js +3 -0
- package/dist/better-auth/generated-types.d.ts +329 -0
- package/dist/better-auth/generated-types.d.ts.map +1 -0
- package/dist/better-auth/generated-types.js +4 -0
- package/dist/better-auth/index.d.ts +4 -0
- package/dist/better-auth/index.d.ts.map +1 -0
- package/dist/better-auth/index.js +5 -0
- package/dist/better-auth/plugin/constants.d.ts +231 -0
- package/dist/better-auth/plugin/constants.d.ts.map +1 -0
- package/dist/better-auth/plugin/constants.js +259 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +13 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.js +14 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +30 -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 +46 -0
- 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-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-better-auth-schema.d.ts +19 -0
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +75 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +6 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.js +20 -0
- package/dist/better-auth/plugin/helpers/get-collection.d.ts +28 -0
- package/dist/better-auth/plugin/helpers/get-collection.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-collection.js +49 -0
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/get-ip.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-ip.js +31 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.js +63 -0
- package/dist/better-auth/plugin/helpers/index.d.ts +2 -0
- package/dist/better-auth/plugin/helpers/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/index.js +3 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +60 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +49 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts +21 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +63 -0
- package/dist/better-auth/plugin/index.d.ts +8 -0
- package/dist/better-auth/plugin/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/index.js +103 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts +13 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js +87 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +4 -0
- 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 +51 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +4 -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 +150 -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 +117 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +4 -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 +174 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.js +49 -0
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts +11 -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 +79 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +4 -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 +93 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +4 -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 +58 -0
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts +4 -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 +72 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +4 -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 +105 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +4 -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 +117 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +4 -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 +87 -0
- 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 +4 -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 +106 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +4 -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 +115 -0
- 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 +4 -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 +140 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +4 -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 +80 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +110 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.js +63 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +4 -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 +74 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +4 -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 +66 -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/generate-invite-url.d.ts +12 -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 +68 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +5 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +6 -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 +114 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +4 -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 +64 -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 +90 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +7 -0
- 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 +80 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +3 -0
- 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 +79 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +3 -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 +54 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +7 -0
- 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 +15 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js +8 -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 +17 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +3 -0
- 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 +90 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +4 -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 +333 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +16 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +24 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +11 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +112 -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/build-collections/utils/model-field-transformations.d.ts +12 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +26 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +18 -0
- 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 +84 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +21 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +95 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +4 -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 +82 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +6 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js +9 -0
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +8 -0
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js +16 -0
- 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 +12 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +3 -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 +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js +8 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +12 -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 +146 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +3 -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 +18 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +3 -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 +34 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +3 -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 +11 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +3 -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 +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js +11 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts +8 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-after-role-middleware.js +20 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts +8 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/admin-before-role-middleware.js +20 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts +14 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/apply-save-to-jwt-returned.js +38 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +8 -0
- 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/sanitize-better-auth-options/utils/password.d.ts +26 -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/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +42 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +62 -0
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts +5 -0
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/set-login-methods.js +14 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +10 -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 +116 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.scss +36 -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 +213 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.scss +136 -0
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/login-form/alternative-methods.js +197 -0
- package/dist/better-auth/plugin/payload/components/login-form/context.d.ts +49 -0
- package/dist/better-auth/plugin/payload/components/login-form/context.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/login-form/context.js +94 -0
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/login-form/credentials-form.js +167 -0
- package/dist/better-auth/plugin/payload/components/login-form/index.d.ts +5 -0
- package/dist/better-auth/plugin/payload/components/login-form/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/login-form/index.js +6 -0
- package/dist/better-auth/plugin/payload/components/login-form/index.scss +58 -0
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts +5 -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 +24 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.js +122 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts +3 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.js +61 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts +5 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.js +42 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.scss +98 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.js +57 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts +23 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.js +3 -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 +13 -0
- package/dist/better-auth/plugin/payload/components/token-field.d.ts +4 -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 +29 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js +347 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.scss +116 -0
- package/dist/better-auth/plugin/payload/exports/client.d.ts +7 -0
- package/dist/better-auth/plugin/payload/exports/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/exports/client.js +8 -0
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +9 -0
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js +10 -0
- 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 +9 -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 +22 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +23 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.js +24 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +11 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.js +143 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +23 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.js +185 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +10 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js +92 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.d.ts +7 -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 +104 -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 +61 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +11 -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 +111 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +9 -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 +78 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts +9 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js +79 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +10 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts.map +1 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +49 -0
- package/dist/better-auth/plugin/types.d.ts +448 -0
- package/dist/better-auth/plugin/types.d.ts.map +1 -0
- package/dist/better-auth/plugin/types.js +3 -0
- package/dist/better-auth/plugin/utils/set.d.ts +40 -0
- package/dist/better-auth/plugin/utils/set.d.ts.map +1 -0
- package/dist/better-auth/plugin/utils/set.js +84 -0
- package/dist/better-auth/scripts/generate-types.d.ts +2 -0
- package/dist/better-auth/scripts/generate-types.d.ts.map +1 -0
- package/dist/better-auth/scripts/generate-types.js +225 -0
- package/dist/better-auth/types.d.ts +3 -0
- package/dist/better-auth/types.d.ts.map +1 -0
- package/dist/better-auth/types.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/shared/components/icons.d.ts +8 -0
- package/dist/shared/components/icons.d.ts.map +1 -0
- package/dist/shared/components/icons.js +436 -0
- package/dist/shared/components/logo.d.ts +3 -0
- package/dist/shared/components/logo.d.ts.map +1 -0
- package/dist/shared/components/logo.js +24 -0
- package/dist/shared/form/components/submit.d.ts +8 -0
- package/dist/shared/form/components/submit.d.ts.map +1 -0
- package/dist/shared/form/components/submit.js +23 -0
- package/dist/shared/form/fields/text-field.d.ts +9 -0
- package/dist/shared/form/fields/text-field.d.ts.map +1 -0
- package/dist/shared/form/fields/text-field.js +44 -0
- package/dist/shared/form/index.d.ts +28 -0
- package/dist/shared/form/index.d.ts.map +1 -0
- package/dist/shared/form/index.js +17 -0
- package/dist/shared/form/ui/header/index.d.ts +9 -0
- package/dist/shared/form/ui/header/index.d.ts.map +1 -0
- package/dist/shared/form/ui/header/index.js +23 -0
- package/dist/shared/form/ui/header/index.scss +8 -0
- package/dist/shared/form/ui/index.d.ts +34 -0
- package/dist/shared/form/ui/index.d.ts.map +1 -0
- package/dist/shared/form/ui/index.js +70 -0
- package/dist/shared/form/ui/index.scss +27 -0
- package/dist/shared/form/validation.d.ts +65 -0
- package/dist/shared/form/validation.d.ts.map +1 -0
- package/dist/shared/form/validation.js +108 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/payload/fields/field-copy-button/index.css +47 -0
- package/dist/shared/payload/fields/field-copy-button/index.d.ts +4 -0
- package/dist/shared/payload/fields/field-copy-button/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/field-copy-button/index.js +38 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.css +14 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +4 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.js +26 -0
- package/dist/shared/payload/fields/index.d.ts +3 -0
- package/dist/shared/payload/fields/index.d.ts.map +1 -0
- package/dist/shared/payload/fields/index.js +4 -0
- package/dist/shared/utils/regex.d.ts +3 -0
- package/dist/shared/utils/regex.d.ts.map +1 -0
- package/dist/shared/utils/regex.js +4 -0
- package/dist/shared/utils/try-catch.d.ts +12 -0
- package/dist/shared/utils/try-catch.d.ts.map +1 -0
- package/dist/shared/utils/try-catch.js +17 -0
- package/dist/shared/utils/value-or-default.d.ts +10 -0
- package/dist/shared/utils/value-or-default.d.ts.map +1 -0
- package/dist/shared/utils/value-or-default.js +12 -0
- package/package.json +124 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Button, Modal, Select, TextInput, toast, useConfig, useModal } from "@payloadcms/ui";
|
|
4
|
+
import { Copy, Loader2, XIcon } from "lucide-react";
|
|
5
|
+
import { usePathname } from "next/navigation";
|
|
6
|
+
import React, { useState } from "react";
|
|
7
|
+
import { adminEndpoints } from "../../../constants";
|
|
8
|
+
import "./index.scss";
|
|
9
|
+
const baseClass = "admin-invite-modal";
|
|
10
|
+
export function AdminInviteButton({ roles }) {
|
|
11
|
+
const [role, setRole] = useState(undefined);
|
|
12
|
+
const [email, setEmail] = useState("");
|
|
13
|
+
const [inviteLink, setInviteLink] = useState("");
|
|
14
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
15
|
+
const [isCopyLoading, setIsCopyLoading] = useState(false);
|
|
16
|
+
const { toggleModal } = useModal();
|
|
17
|
+
const { config: { serverURL, routes: { api: apiRoute, admin: adminRoute }, admin: { user: userSlug } } } = useConfig();
|
|
18
|
+
// Only render invite button in list view.
|
|
19
|
+
const pathname = usePathname();
|
|
20
|
+
if (pathname !== `${adminRoute}/collections/${userSlug}`) return null;
|
|
21
|
+
const handleGenerateInvite = async ()=>{
|
|
22
|
+
if (!role) {
|
|
23
|
+
toast.error("Please select a role first");
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const url = `${serverURL}${apiRoute}/${userSlug}${adminEndpoints.generateInviteUrl}`;
|
|
28
|
+
const response = await fetch(url, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers: {
|
|
31
|
+
"Content-Type": "application/json"
|
|
32
|
+
},
|
|
33
|
+
body: JSON.stringify({
|
|
34
|
+
role
|
|
35
|
+
}),
|
|
36
|
+
credentials: "include"
|
|
37
|
+
});
|
|
38
|
+
if (!response.ok) throw new Error("Failed to generate invite");
|
|
39
|
+
const data = await response.json();
|
|
40
|
+
setInviteLink(data.inviteLink);
|
|
41
|
+
return data.inviteLink;
|
|
42
|
+
} catch (error) {
|
|
43
|
+
toast.error("Failed to generate invite link");
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const handleSendEmail = async ()=>{
|
|
48
|
+
if (!role) {
|
|
49
|
+
toast.error("Please select a role first");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (!email) {
|
|
53
|
+
toast.error("Please enter an email address");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
setIsLoading(true);
|
|
58
|
+
let linkToCopy = inviteLink;
|
|
59
|
+
if (!linkToCopy) {
|
|
60
|
+
linkToCopy = await handleGenerateInvite();
|
|
61
|
+
}
|
|
62
|
+
if (linkToCopy) {
|
|
63
|
+
const response = await fetch(`${serverURL}${apiRoute}/${userSlug}${adminEndpoints.sendInvite}`, {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers: {
|
|
66
|
+
"Content-Type": "application/json"
|
|
67
|
+
},
|
|
68
|
+
body: JSON.stringify({
|
|
69
|
+
email,
|
|
70
|
+
link: linkToCopy
|
|
71
|
+
}),
|
|
72
|
+
credentials: "include"
|
|
73
|
+
});
|
|
74
|
+
if (!response.ok) throw new Error("Failed to send invite");
|
|
75
|
+
toast.success("Invite sent successfully");
|
|
76
|
+
handleToggleModal();
|
|
77
|
+
}
|
|
78
|
+
} catch (error) {
|
|
79
|
+
toast.error("Failed to send invite email");
|
|
80
|
+
} finally{
|
|
81
|
+
setIsLoading(false);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const handleCopyLink = async ()=>{
|
|
85
|
+
if (!role) {
|
|
86
|
+
toast.error("Please select a role first");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
setIsCopyLoading(true);
|
|
91
|
+
let linkToCopy = inviteLink;
|
|
92
|
+
if (!linkToCopy) {
|
|
93
|
+
linkToCopy = await handleGenerateInvite();
|
|
94
|
+
}
|
|
95
|
+
if (linkToCopy) {
|
|
96
|
+
await navigator.clipboard.writeText(linkToCopy);
|
|
97
|
+
toast.success("Invite link copied to clipboard");
|
|
98
|
+
toggleModal("admin-invite-modal");
|
|
99
|
+
}
|
|
100
|
+
} catch (error) {
|
|
101
|
+
toast.error("Failed to copy invite link");
|
|
102
|
+
} finally{
|
|
103
|
+
setIsCopyLoading(false);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const handleToggleModal = ()=>{
|
|
107
|
+
toggleModal("admin-invite-modal");
|
|
108
|
+
};
|
|
109
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
110
|
+
children: [
|
|
111
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
112
|
+
onClick: handleToggleModal,
|
|
113
|
+
type: "button",
|
|
114
|
+
size: "small",
|
|
115
|
+
buttonStyle: "pill",
|
|
116
|
+
className: "admin-invite-button",
|
|
117
|
+
children: "Invite User"
|
|
118
|
+
}),
|
|
119
|
+
/*#__PURE__*/ _jsx(Modal, {
|
|
120
|
+
slug: "admin-invite-modal",
|
|
121
|
+
className: `${baseClass}`,
|
|
122
|
+
closeOnBlur: true,
|
|
123
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
124
|
+
className: `${baseClass}__wrapper`,
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
127
|
+
onClick: handleToggleModal,
|
|
128
|
+
buttonStyle: "icon-label",
|
|
129
|
+
size: "small",
|
|
130
|
+
className: `${baseClass}__close-button`,
|
|
131
|
+
children: /*#__PURE__*/ _jsx(XIcon, {
|
|
132
|
+
size: 24
|
|
133
|
+
})
|
|
134
|
+
}),
|
|
135
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
136
|
+
className: `${baseClass}__content`,
|
|
137
|
+
style: {
|
|
138
|
+
maxWidth: "38rem"
|
|
139
|
+
},
|
|
140
|
+
children: [
|
|
141
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
142
|
+
children: "Invite User"
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ _jsx("p", {
|
|
145
|
+
children: "Invite a user to your application. Select the role of the user and send the invite via email or copy the invite link."
|
|
146
|
+
}),
|
|
147
|
+
/*#__PURE__*/ _jsx(Select, {
|
|
148
|
+
options: roles,
|
|
149
|
+
value: role,
|
|
150
|
+
placeholder: "Select Role",
|
|
151
|
+
onChange: (option)=>setRole(option)
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
154
|
+
className: `${baseClass}__invite-controls`,
|
|
155
|
+
children: [
|
|
156
|
+
/*#__PURE__*/ _jsx("div", {
|
|
157
|
+
className: `${baseClass}__email-field`,
|
|
158
|
+
children: /*#__PURE__*/ _jsx(TextInput, {
|
|
159
|
+
label: "Email Address",
|
|
160
|
+
path: "email",
|
|
161
|
+
value: email,
|
|
162
|
+
onChange: (e)=>setEmail(e.target.value),
|
|
163
|
+
placeholder: "user@example.com"
|
|
164
|
+
})
|
|
165
|
+
}),
|
|
166
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
167
|
+
className: `${baseClass}__buttons`,
|
|
168
|
+
children: [
|
|
169
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
170
|
+
type: "button",
|
|
171
|
+
onClick: handleSendEmail,
|
|
172
|
+
disabled: isLoading || !role || !email,
|
|
173
|
+
children: [
|
|
174
|
+
isLoading ? /*#__PURE__*/ _jsx(Loader2, {
|
|
175
|
+
size: 24,
|
|
176
|
+
className: "mr-2 animate-spin"
|
|
177
|
+
}) : null,
|
|
178
|
+
"Send Email"
|
|
179
|
+
]
|
|
180
|
+
}),
|
|
181
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
182
|
+
size: "medium",
|
|
183
|
+
buttonStyle: "transparent",
|
|
184
|
+
className: `${baseClass}__copy-button`,
|
|
185
|
+
type: "button",
|
|
186
|
+
onClick: handleCopyLink,
|
|
187
|
+
disabled: isCopyLoading || !role,
|
|
188
|
+
children: [
|
|
189
|
+
isCopyLoading ? /*#__PURE__*/ _jsx(Loader2, {
|
|
190
|
+
size: 20,
|
|
191
|
+
strokeWidth: 1.5,
|
|
192
|
+
className: "animate-spin"
|
|
193
|
+
}) : /*#__PURE__*/ _jsx(Copy, {
|
|
194
|
+
size: 20,
|
|
195
|
+
strokeWidth: 1.5
|
|
196
|
+
}),
|
|
197
|
+
"Generate Link"
|
|
198
|
+
]
|
|
199
|
+
})
|
|
200
|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lxuICAgICAgICAgICAgPGgyPkludml0ZSBVc2VyPC9oMj5cbiAgICAgICAgICAgIDxwPlxuICAgICAgICAgICAgICBJbnZpdGUgYSB1c2VyIHRvIHlvdXIgYXBwbGljYXRpb24uIFNlbGVjdCB0aGUgcm9sZSBvZiB0aGUgdXNlciBhbmRcbiAgICAgICAgICAgICAgc2VuZCB0aGUgaW52aXRlIHZpYSBlbWFpbCBvciBjb3B5IHRoZSBpbnZpdGUgbGluay5cbiAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgIDxTZWxlY3RcbiAgICAgICAgICAgICAgb3B0aW9ucz17cm9sZXN9XG4gICAgICAgICAgICAgIHZhbHVlPXtyb2xlfVxuICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIlNlbGVjdCBSb2xlXCJcbiAgICAgICAgICAgICAgb25DaGFuZ2U9eyhvcHRpb246IGFueSkgPT4gc2V0Um9sZShvcHRpb24pfVxuICAgICAgICAgICAgLz5cblxuICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9e2Ake2Jhc2VDbGFzc31fX2ludml0ZS1jb250cm9sc2B9PlxuICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT17YCR7YmFzZUNsYXNzfV9fZW1haWwtZmllbGRgfT5cbiAgICAgICAgICAgICAgICA8VGV4dElucHV0XG4gICAgICAgICAgICAgICAgICBsYWJlbD1cIkVtYWlsIEFkZHJlc3NcIlxuICAgICAgICAgICAgICAgICAgcGF0aD1cImVtYWlsXCJcbiAgICAgICAgICAgICAgICAgIHZhbHVlPXtlbWFpbH1cbiAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXsoZTogYW55KSA9PiBzZXRFbWFpbChlLnRhcmdldC52YWx1ZSl9XG4gICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cInVzZXJAZXhhbXBsZS5jb21cIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPXtgJHtiYXNlQ2xhc3N9X19idXR0b25zYH0+XG4gICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgdHlwZT1cImJ1dHRvblwiXG4gICAgICAgICAgICAgICAgICBvbkNsaWNrPXtoYW5kbGVTZW5kRW1haWx9XG4gICAgICAgICAgICAgICAgICBkaXNhYmxlZD17aXNMb2FkaW5nIHx8ICFyb2xlIHx8ICFlbWFpbH1cbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICB7aXNMb2FkaW5nID8gKFxuICAgICAgICAgICAgICAgICAgICA8TG9hZGVyMiBzaXplPXsyNH0gY2xhc3NOYW1lPVwibXItMiBhbmltYXRlLXNwaW5cIiAvPlxuICAgICAgICAgICAgICAgICAgKSA6IG51bGx9XG4gICAgICAgICAgICAgICAgICBTZW5kIEVtYWlsXG4gICAgICAgICAgICAgICAgPC9CdXR0b24+XG5cbiAgICAgICAgICAgICAgICA8QnV0dG9uXG4gICAgICAgICAgICAgICAgICBzaXplPVwibWVkaXVtXCJcbiAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlPVwidHJhbnNwYXJlbnRcIlxuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPXtgJHtiYXNlQ2xhc3N9X19jb3B5LWJ1dHRvbmB9XG4gICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgICAgICAgICAgIG9uQ2xpY2s9e2hhbmRsZUNvcHlMaW5rfVxuICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ9e2lzQ29weUxvYWRpbmcgfHwgIXJvbGV9XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAge2lzQ29weUxvYWRpbmcgPyAoXG4gICAgICAgICAgICAgICAgICAgIDxMb2FkZXIyXG4gICAgICAgICAgICAgICAgICAgICAgc2l6ZT17MjB9XG4gICAgICAgICAgICAgICAgICAgICAgc3Ryb2tlV2lkdGg9ezEuNX1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FdBQVU7MkVBR1osS0FBQzlEOzREQUFLNEQsTUFBTTs0REFBSW9CLGFBQWE7O3dEQUM3Qjs7Ozs7Ozs7Ozs7Ozs7QUFVcEIifQ==
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
@mixin blur-bg($color: var(--theme-bg), $opacity: 0.75) {
|
|
2
|
+
|
|
3
|
+
&:before,
|
|
4
|
+
&:after {
|
|
5
|
+
content: ' ';
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:before {
|
|
14
|
+
background: $color;
|
|
15
|
+
opacity: $opacity;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:after {
|
|
19
|
+
backdrop-filter: blur(8px);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@layer payload-default {
|
|
24
|
+
.list-header:has(.collection-list__sub-header .admin-invite-button) {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.list-header:has(.collection-list__sub-header .admin-invite-button) .list-selection {
|
|
30
|
+
order: 2;
|
|
31
|
+
margin-left: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.list-header:has(.collection-list__sub-header .admin-invite-button) .collection-list__sub-header {
|
|
35
|
+
margin-left: auto;
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: flex-start;
|
|
38
|
+
flex-basis: auto !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.list-header:has(.collection-list__sub-header .admin-invite-button) .btn {
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
margin-bottom: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@layer payload-default {
|
|
48
|
+
.admin-invite-modal {
|
|
49
|
+
@include blur-bg;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
height: 100%;
|
|
54
|
+
|
|
55
|
+
&__wrapper {
|
|
56
|
+
z-index: 1;
|
|
57
|
+
position: relative;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 16px;
|
|
61
|
+
border-radius: 3px;
|
|
62
|
+
border: 1px solid var(--theme-border-color);
|
|
63
|
+
background-color: var(--theme-elevation-50);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__close-button {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
right: 0;
|
|
70
|
+
margin-block: 0 !important;
|
|
71
|
+
padding: 10px !important;
|
|
72
|
+
|
|
73
|
+
svg {
|
|
74
|
+
width: 24px;
|
|
75
|
+
height: 24px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__content {
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
gap: 1.5rem;
|
|
83
|
+
padding: 1rem;
|
|
84
|
+
|
|
85
|
+
h1 {
|
|
86
|
+
font-size: 1.5rem;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
p {
|
|
92
|
+
margin: 0;
|
|
93
|
+
color: var(--theme-elevation-500);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__invite-controls {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
gap: 1rem;
|
|
101
|
+
margin-top: 0.5rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&__email-field {
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__buttons {
|
|
109
|
+
display: flex;
|
|
110
|
+
gap: 1rem;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: flex-end;
|
|
113
|
+
|
|
114
|
+
>.btn {
|
|
115
|
+
margin-block: 0.5rem !important;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&__copy-button {
|
|
120
|
+
&:hover {
|
|
121
|
+
background-color: var(--theme-elevation-200) !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.btn__label {
|
|
125
|
+
gap: 0.5rem;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.admin-invite-button {
|
|
134
|
+
display: block;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alternative-methods.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/login-form/alternative-methods.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,cAAc,CAAC;AAsKtB,wBAAgB,kBAAkB,6BA2CjC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Button, toast } from "@payloadcms/ui";
|
|
4
|
+
import { Key, Mail } from "lucide-react";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { socialProviders } from "../../../constants";
|
|
8
|
+
import { Icons } from "../../../../../shared/components/icons";
|
|
9
|
+
import { isValidEmail } from "../../../../../shared/form/validation";
|
|
10
|
+
import { useLoginForm } from "./context";
|
|
11
|
+
import "./index.scss";
|
|
12
|
+
const baseClass = "login-form-methods";
|
|
13
|
+
function MagicLinkButton() {
|
|
14
|
+
const { email, authClient, redirectUrl, showIconOnly } = useLoginForm();
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const [sent, setSent] = useState(false);
|
|
17
|
+
const sentEmailRef = useRef("");
|
|
18
|
+
useEffect(()=>{
|
|
19
|
+
if (sent && email !== sentEmailRef.current) {
|
|
20
|
+
setSent(false);
|
|
21
|
+
}
|
|
22
|
+
}, [
|
|
23
|
+
email,
|
|
24
|
+
sent
|
|
25
|
+
]);
|
|
26
|
+
const handleClick = async ()=>{
|
|
27
|
+
if (!email) {
|
|
28
|
+
toast.error("Please enter your email address");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!isValidEmail(email)) {
|
|
32
|
+
toast.error("Please enter a valid email address");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setLoading(true);
|
|
36
|
+
try {
|
|
37
|
+
const { error } = await authClient.signIn.magicLink({
|
|
38
|
+
email,
|
|
39
|
+
callbackURL: redirectUrl
|
|
40
|
+
});
|
|
41
|
+
if (error) {
|
|
42
|
+
toast.error(error.message || "Failed to send magic link");
|
|
43
|
+
} else {
|
|
44
|
+
sentEmailRef.current = email;
|
|
45
|
+
setSent(true);
|
|
46
|
+
toast.success("Magic link sent! Check your email.");
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
toast.error(error?.message || "Failed to send magic link");
|
|
50
|
+
} finally{
|
|
51
|
+
setLoading(false);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const label = sent ? "Resend Magic Link" : "Magic Link";
|
|
55
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
56
|
+
type: "button",
|
|
57
|
+
size: "large",
|
|
58
|
+
className: `${baseClass}__button provider--magic-link`,
|
|
59
|
+
onClick: handleClick,
|
|
60
|
+
disabled: loading,
|
|
61
|
+
iconPosition: "left",
|
|
62
|
+
icon: /*#__PURE__*/ _jsx(Mail, {
|
|
63
|
+
className: `${baseClass}__icon`
|
|
64
|
+
}),
|
|
65
|
+
tooltip: showIconOnly ? "Sign in with Magic Link" : undefined,
|
|
66
|
+
children: !showIconOnly && /*#__PURE__*/ _jsx("span", {
|
|
67
|
+
children: loading ? "Sending..." : label
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function PasskeyButton({ setLoading }) {
|
|
72
|
+
const router = useRouter();
|
|
73
|
+
const { authClient, redirectUrl, showIconOnly } = useLoginForm();
|
|
74
|
+
const handleClick = async ()=>{
|
|
75
|
+
setLoading(true);
|
|
76
|
+
try {
|
|
77
|
+
await authClient.signIn.passkey({
|
|
78
|
+
fetchOptions: {
|
|
79
|
+
onSuccess () {
|
|
80
|
+
if (redirectUrl) router.push(redirectUrl);
|
|
81
|
+
},
|
|
82
|
+
onError (context) {
|
|
83
|
+
toast.error(context.error.message || "Failed to sign in with passkey");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
} catch (error) {
|
|
88
|
+
toast.error(error?.message || "Failed to sign in with passkey");
|
|
89
|
+
} finally{
|
|
90
|
+
setLoading(false);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
94
|
+
type: "button",
|
|
95
|
+
size: "large",
|
|
96
|
+
className: `${baseClass}__button provider--passkey`,
|
|
97
|
+
onClick: handleClick,
|
|
98
|
+
iconPosition: "left",
|
|
99
|
+
icon: /*#__PURE__*/ _jsx(Key, {
|
|
100
|
+
className: `${baseClass}__icon`
|
|
101
|
+
}),
|
|
102
|
+
tooltip: showIconOnly ? "Sign in with Passkey" : undefined,
|
|
103
|
+
children: !showIconOnly && /*#__PURE__*/ _jsx("span", {
|
|
104
|
+
children: "Passkey"
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function SocialButton({ provider, setLoading }) {
|
|
109
|
+
const { authClient, redirectUrl, isSignup, showIconOnly, adminInviteToken, newUserCallbackURL } = useLoginForm();
|
|
110
|
+
const Icon = Icons[provider] ?? null;
|
|
111
|
+
const providerName = provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
112
|
+
const handleClick = async ()=>{
|
|
113
|
+
setLoading(true);
|
|
114
|
+
try {
|
|
115
|
+
const { error } = await authClient.signIn.social({
|
|
116
|
+
provider,
|
|
117
|
+
fetchOptions: {
|
|
118
|
+
query: {
|
|
119
|
+
...isSignup && {
|
|
120
|
+
adminInviteToken
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
errorCallbackURL: window.location.href,
|
|
125
|
+
callbackURL: redirectUrl,
|
|
126
|
+
newUserCallbackURL,
|
|
127
|
+
...isSignup && {
|
|
128
|
+
requestSignUp: true
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (error) {
|
|
132
|
+
toast.error(error.message);
|
|
133
|
+
}
|
|
134
|
+
} catch {
|
|
135
|
+
toast.error(`Failed to sign in with ${providerName}`);
|
|
136
|
+
} finally{
|
|
137
|
+
setLoading(false);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
141
|
+
type: "button",
|
|
142
|
+
size: "large",
|
|
143
|
+
className: `${baseClass}__button provider--${provider}`,
|
|
144
|
+
onClick: handleClick,
|
|
145
|
+
iconPosition: "left",
|
|
146
|
+
icon: Icon ? /*#__PURE__*/ _jsx(Icon, {
|
|
147
|
+
className: `${baseClass}__icon`
|
|
148
|
+
}) : undefined,
|
|
149
|
+
tooltip: showIconOnly ? `Sign in with ${providerName}` : undefined,
|
|
150
|
+
children: !showIconOnly && /*#__PURE__*/ _jsx("span", {
|
|
151
|
+
children: providerName
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export function AlternativeMethods() {
|
|
156
|
+
const { alternativeMethods, hasMethod, isSignup, showIconOnly } = useLoginForm();
|
|
157
|
+
const [_, setLoading] = useState(false);
|
|
158
|
+
if (alternativeMethods.length === 0) return null;
|
|
159
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
160
|
+
children: [
|
|
161
|
+
hasMethod("emailPassword") && /*#__PURE__*/ _jsx("div", {
|
|
162
|
+
className: `${baseClass}__divider`,
|
|
163
|
+
children: /*#__PURE__*/ _jsxs("span", {
|
|
164
|
+
children: [
|
|
165
|
+
"Or ",
|
|
166
|
+
isSignup ? "sign up" : "login",
|
|
167
|
+
" with"
|
|
168
|
+
]
|
|
169
|
+
})
|
|
170
|
+
}),
|
|
171
|
+
/*#__PURE__*/ _jsx("div", {
|
|
172
|
+
className: `${baseClass} ${baseClass}--count-${showIconOnly ? "many" : alternativeMethods.length}`,
|
|
173
|
+
children: alternativeMethods.map((method)=>{
|
|
174
|
+
if (method === "passkey") {
|
|
175
|
+
if (isSignup) return null;
|
|
176
|
+
return /*#__PURE__*/ _jsx(PasskeyButton, {
|
|
177
|
+
setLoading: setLoading
|
|
178
|
+
}, method);
|
|
179
|
+
}
|
|
180
|
+
if (method === "magicLink") {
|
|
181
|
+
if (isSignup) return null;
|
|
182
|
+
return /*#__PURE__*/ _jsx(MagicLinkButton, {}, method);
|
|
183
|
+
}
|
|
184
|
+
if (socialProviders.includes(method)) {
|
|
185
|
+
return /*#__PURE__*/ _jsx(SocialButton, {
|
|
186
|
+
provider: method,
|
|
187
|
+
setLoading: setLoading
|
|
188
|
+
}, method);
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9jb21wb25lbnRzL2xvZ2luLWZvcm0vYWx0ZXJuYXRpdmUtbWV0aG9kcy50c3giXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2UgY2xpZW50XCI7XG5cbmltcG9ydCB7IEJ1dHRvbiwgdG9hc3QgfSBmcm9tIFwiQHBheWxvYWRjbX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YgKG1ldGhvZCA9PT0gXCJtYWdpY0xpbmtcIikge1xuICAgICAgICAgICAgaWYgKGlzU2lnbnVwKSByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIHJldHVybiA8TWFnaWNMaW5rQnV0dG9uIGtleT17bWV0aG9kfSAvPjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc29jaWFsUHJvdmlkZXJzLmluY2x1ZGVzKG1ldGhvZCBhcyBTb2NpYWxQcm92aWRlcikpIHtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgIDxTb2NpYWxCdXR0b25cbiAgICAgICAgICAgICAgICBrZXk9e21ldGhvZH1cbiAgICAgICAgICAgICAgICBwcm92aWRlcj17bWV0aG9kIGFzIFNvY2lhbFByb3ZpZGVyfVxuICAgICAgICAgICAgICAgIHNldExvYWRpbmc9e3NldExvYWRpbmd9XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9KX1cbiAgICAgIDwvZGl2PlxuICAgIDwvPlxuICApO1xufVxuIl0sIm5hbWVzIjpbIkJ1dHRvbiIsInRvYXN0IiwiS2V5IiwiTWFpbCIsInVzZVJvdXRlciIsIlJlYWN0IiwidXNlRWZmZWN0IiwidXNlUmVmIiwidXNlU3RhdGUiLCJzb2NpYWxQcm92aWRlcnMiLCJJY29ucyIsImlzVmFsaWRFbWFpbCIsInVzZUxvZ2luRm9ybSIsImJhc2VDbGFzcyIsIk1hZ2ljTGlua0J1dHRvbiIsImVtYWlsIiwiYXV0aENsaWVudCIsInJlZGlyZWN0VXJsIiwic2hvd0ljb25Pbmx5IiwibG9hZGluZyIsInNldExvYWRpbmciLCJzZW50Iiwic2V0U2VudCIsInNlbnRFbWFpbFJlZiIsImN1cnJlbnQiLCJoYW5kbGVDbGljayIsImVycm9yIiwic2lnbkluIiwibWFnaWNMaW5rIiwiY2FsbGJhY2tVUkwi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QUcsQ0FBQyxDQUFDQztvQkFDdkIsSUFBSUEsV0FBVyxXQUFXO3dCQUN4QixJQUFJdEIsVUFBVSxPQUFPO3dCQUNyQixxQkFBTyxLQUFDVjs0QkFBMkJ2QixZQUFZQTsyQkFBcEJ1RDtvQkFDN0I7b0JBRUEsSUFBSUEsV0FBVyxhQUFhO3dCQUMxQixJQUFJdEIsVUFBVSxPQUFPO3dCQUNyQixxQkFBTyxLQUFDdkMscUJBQXFCNkQ7b0JBQy9CO29CQUVBLElBQUlsRSxnQkFBZ0JtRSxRQUFRLENBQUNELFNBQTJCO3dCQUN0RCxxQkFDRSxLQUFDeEI7NEJBRUNDLFVBQVV1Qjs0QkFDVnZELFlBQVlBOzJCQUZQdUQ7b0JBS1g7b0JBRUEsT0FBTztnQkFDVDs7OztBQUlSIn0=
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { LoginMethod } from "@/better-auth/plugin/types";
|
|
3
|
+
interface LoginFormContextValue {
|
|
4
|
+
loginMethods: LoginMethod[];
|
|
5
|
+
email: string;
|
|
6
|
+
setEmail: (email: string) => void;
|
|
7
|
+
redirectUrl: string;
|
|
8
|
+
isSignup: boolean;
|
|
9
|
+
authClient: any;
|
|
10
|
+
loginType: "email" | "username" | "emailOrUsername";
|
|
11
|
+
hasMethod: (method: LoginMethod) => boolean;
|
|
12
|
+
alternativeMethods: LoginMethod[];
|
|
13
|
+
showIconOnly: boolean;
|
|
14
|
+
adminInviteToken?: string;
|
|
15
|
+
newUserCallbackURL?: string;
|
|
16
|
+
prefill: {
|
|
17
|
+
email?: string;
|
|
18
|
+
password?: string;
|
|
19
|
+
username?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
type Prefill = {
|
|
23
|
+
email?: string;
|
|
24
|
+
password?: string;
|
|
25
|
+
username?: string;
|
|
26
|
+
};
|
|
27
|
+
type Plugins = {
|
|
28
|
+
username?: boolean;
|
|
29
|
+
passkey?: boolean;
|
|
30
|
+
magicLink?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type LoginIdentifier = "email" | "username";
|
|
33
|
+
export interface LoginFormProviderProps {
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
loginMethods: LoginMethod[];
|
|
36
|
+
redirectUrl: string;
|
|
37
|
+
baseURL?: string;
|
|
38
|
+
basePath?: string;
|
|
39
|
+
isSignup?: boolean;
|
|
40
|
+
loginIdentifiers: LoginIdentifier[];
|
|
41
|
+
plugins?: Plugins;
|
|
42
|
+
prefill?: Prefill;
|
|
43
|
+
adminInviteToken?: string;
|
|
44
|
+
newUserCallbackURL?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function LoginFormProvider({ children, loginMethods, redirectUrl, baseURL, basePath, isSignup, loginIdentifiers, plugins, prefill, adminInviteToken, newUserCallbackURL }: LoginFormProviderProps): React.JSX.Element;
|
|
47
|
+
export declare const useLoginForm: () => LoginFormContextValue;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/components/login-form/context.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,UAAU,qBAAqB;IAC7B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,CAAC;IACpD,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;IAC5C,kBAAkB,EAAE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