@revealui/auth 0.0.1-pre.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/LICENSE +202 -0
- package/dist/better-auth/adapter/__tests__/transform.test.js +213 -0
- package/dist/better-auth/adapter/__tests__/transform.test.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/biome.d.js +2 -0
- package/dist/better-auth/adapter/generate-schema/biome.d.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.d.ts +5 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js +482 -0
- package/dist/better-auth/adapter/generate-schema/generate-schema-builder.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.d.ts +1 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js +42 -0
- package/dist/better-auth/adapter/generate-schema/get-payload-schema.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/index.d.ts +4 -0
- package/dist/better-auth/adapter/generate-schema/index.js +19 -0
- package/dist/better-auth/adapter/generate-schema/index.js.map +1 -0
- package/dist/better-auth/adapter/generate-schema/utils.d.ts +2 -0
- package/dist/better-auth/adapter/generate-schema/utils.js +20 -0
- package/dist/better-auth/adapter/generate-schema/utils.js.map +1 -0
- package/dist/better-auth/adapter/index.d.ts +15 -0
- package/dist/better-auth/adapter/index.js +731 -0
- package/dist/better-auth/adapter/index.js.map +1 -0
- package/dist/better-auth/adapter/tests/adapter.test.js +174 -0
- package/dist/better-auth/adapter/tests/adapter.test.js.map +1 -0
- package/dist/better-auth/adapter/tests/base-collections-tests.js +575 -0
- package/dist/better-auth/adapter/tests/base-collections-tests.js.map +1 -0
- package/dist/better-auth/adapter/tests/dev/index.js +117 -0
- package/dist/better-auth/adapter/tests/dev/index.js.map +1 -0
- package/dist/better-auth/adapter/tests/dev/migrate.js +26 -0
- package/dist/better-auth/adapter/tests/dev/migrate.js.map +1 -0
- package/dist/better-auth/adapter/tests/dev/migrations/20250423_232936_init.js +218 -0
- package/dist/better-auth/adapter/tests/dev/migrations/20250423_232936_init.js.map +1 -0
- package/dist/better-auth/adapter/tests/dev/schema.js +160 -0
- package/dist/better-auth/adapter/tests/dev/schema.js.map +1 -0
- package/dist/better-auth/adapter/tests/plugins-tests.js +2 -0
- package/dist/better-auth/adapter/tests/plugins-tests.js.map +1 -0
- package/dist/better-auth/adapter/transform/index.d.ts +27 -0
- package/dist/better-auth/adapter/transform/index.js +664 -0
- package/dist/better-auth/adapter/transform/index.js.map +1 -0
- package/dist/better-auth/adapter/types.d.ts +10 -0
- package/dist/better-auth/adapter/types.js +3 -0
- package/dist/better-auth/adapter/types.js.map +1 -0
- package/dist/better-auth/generated-types.d.ts +285 -0
- package/dist/better-auth/index.d.ts +3 -0
- package/dist/better-auth/index.js +5 -0
- package/dist/better-auth/index.js.map +1 -0
- package/dist/better-auth/plugin/__tests__/plugin.test.js +162 -0
- package/dist/better-auth/plugin/__tests__/plugin.test.js.map +1 -0
- package/dist/better-auth/plugin/constants.d.ts +220 -0
- package/dist/better-auth/plugin/constants.js +249 -0
- package/dist/better-auth/plugin/constants.js.map +1 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +12 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.js +14 -0
- package/dist/better-auth/plugin/helpers/check-plugin-exists.js.map +1 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.d.ts +29 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js +46 -0
- package/dist/better-auth/plugin/helpers/generate-verify-email-url.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-admin-access.d.ts +7 -0
- package/dist/better-auth/plugin/helpers/get-admin-access.js +22 -0
- package/dist/better-auth/plugin/helpers/get-admin-access.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.d.ts +5 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.js +20 -0
- package/dist/better-auth/plugin/helpers/get-all-roles.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts +18 -0
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +70 -0
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +5 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.js +20 -0
- package/dist/better-auth/plugin/helpers/get-collection-slug.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-collection.d.ts +15 -0
- package/dist/better-auth/plugin/helpers/get-collection.js +29 -0
- package/dist/better-auth/plugin/helpers/get-collection.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-ip.d.ts +2 -0
- package/dist/better-auth/plugin/helpers/get-ip.js +31 -0
- package/dist/better-auth/plugin/helpers/get-ip.js.map +1 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +2 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.js +65 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.js.map +1 -0
- package/dist/better-auth/plugin/helpers/index.d.ts +1 -0
- package/dist/better-auth/plugin/helpers/index.js +3 -0
- package/dist/better-auth/plugin/helpers/index.js.map +1 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +59 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +49 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.js.map +1 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts +20 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +67 -0
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js.map +1 -0
- package/dist/better-auth/plugin/index.d.ts +11 -0
- package/dist/better-auth/plugin/index.js +125 -0
- package/dist/better-auth/plugin/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.d.ts +12 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js +87 -0
- package/dist/better-auth/plugin/lib/apply-disabled-default-auth-config.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +60 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +154 -0
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +5 -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-after-read.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-before-change.d.ts +2 -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/hooks/get-url-before-change.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +119 -0
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js +177 -0
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.js +50 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts +10 -0
- package/dist/better-auth/plugin/lib/build-collections/index.js +73 -0
- package/dist/better-auth/plugin/lib/build-collections/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.js +94 -0
- package/dist/better-auth/plugin/lib/build-collections/invitations.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.js +59 -0
- package/dist/better-auth/plugin/lib/build-collections/jwks.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/members.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/members.js +73 -0
- package/dist/better-auth/plugin/lib/build-collections/members.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +107 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +118 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +89 -0
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.js +70 -0
- package/dist/better-auth/plugin/lib/build-collections/organizations.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js +115 -0
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.js +170 -0
- package/dist/better-auth/plugin/lib/build-collections/sessions.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +81 -0
- package/dist/better-auth/plugin/lib/build-collections/sso-providers.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +111 -0
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.js +57 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.js +76 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.js +67 -0
- package/dist/better-auth/plugin/lib/build-collections/two-factors.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +53 -0
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.d.ts +11 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +75 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +4 -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/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts +2 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +115 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js +64 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/send-invite-url.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +80 -0
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +6 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +79 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +2 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +82 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +2 -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-delete.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +6 -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/before-login.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +6 -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/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +2 -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/on-verified-change.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +2 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +91 -0
- package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.js +341 -0
- package/dist/better-auth/plugin/lib/build-collections/users/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +15 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +24 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.d.ts +10 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.js +67 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-duplicate-fields.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +9 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +94 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +7 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +35 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js.map +1 -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.js +25 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.d.ts +14 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js +67 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/payload-access.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +20 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +98 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +3 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.js +87 -0
- package/dist/better-auth/plugin/lib/build-collections/verifications.js.map +1 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.d.ts +5 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js +9 -0
- package/dist/better-auth/plugin/lib/get-payload-auth.js.map +1 -0
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +7 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js +46 -0
- package/dist/better-auth/plugin/lib/init-better-auth.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +9 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +2 -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/device-authorization-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +156 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +18 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +34 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +11 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +2 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +10 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +2 -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/two-factor-plugin.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/ensure-password-set-before-create.d.ts +7 -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/ensure-password-set-before-create.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/password.d.ts +25 -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/password.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +9 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +47 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts +15 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +42 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +9 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +63 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js.map +1 -0
- package/dist/better-auth/plugin/lib/set-login-methods.d.ts +4 -0
- package/dist/better-auth/plugin/lib/set-login-methods.js +14 -0
- package/dist/better-auth/plugin/lib/set-login-methods.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.js +143 -0
- package/dist/better-auth/plugin/payload/components/admin-buttons/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.d.ts +10 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js +219 -0
- package/dist/better-auth/plugin/payload/components/admin-invite-button/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/logout-button.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/logout-button.js +24 -0
- package/dist/better-auth/plugin/payload/components/logout-button.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.d.ts +8 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.js +117 -0
- package/dist/better-auth/plugin/payload/components/passkeys/add-button.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.d.ts +3 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.js +66 -0
- package/dist/better-auth/plugin/payload/components/passkeys/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.js +52 -0
- package/dist/better-auth/plugin/payload/components/passkeys/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.d.ts +8 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.js +57 -0
- package/dist/better-auth/plugin/payload/components/passkeys/list.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.d.ts +22 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.js +3 -0
- package/dist/better-auth/plugin/payload/components/passkeys/types.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.d.ts +6 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.js +7 -0
- package/dist/better-auth/plugin/payload/components/rsc-redirect.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.d.ts +15 -0
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.js +157 -0
- package/dist/better-auth/plugin/payload/components/social-provider-buttons/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/token-field.d.ts +4 -0
- package/dist/better-auth/plugin/payload/components/token-field.js +31 -0
- package/dist/better-auth/plugin/payload/components/token-field.js.map +1 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.d.ts +8 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js +300 -0
- package/dist/better-auth/plugin/payload/components/two-factor-auth/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/exports/client.d.ts +6 -0
- package/dist/better-auth/plugin/payload/exports/client.js +8 -0
- package/dist/better-auth/plugin/payload/exports/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/exports/rsc.d.ts +8 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js +10 -0
- package/dist/better-auth/plugin/payload/exports/rsc.js.map +1 -0
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.d.ts +2 -0
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js +9 -0
- package/dist/better-auth/plugin/payload/utils/generate-admin-invite-url.js.map +1 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.d.ts +1 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js +22 -0
- package/dist/better-auth/plugin/payload/utils/get-safe-redirect.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts +19 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.js +226 -0
- package/dist/better-auth/plugin/payload/views/admin-login/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +10 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.js +150 -0
- package/dist/better-auth/plugin/payload/views/admin-login/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +16 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.js +299 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js +104 -0
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js.map +1 -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.js +119 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +8 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js +78 -0
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts +10 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.js +144 -0
- package/dist/better-auth/plugin/payload/views/reset-password/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts +8 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.js +96 -0
- package/dist/better-auth/plugin/payload/views/reset-password/index.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.d.ts +6 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js +96 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/client.js.map +1 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +9 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +56 -0
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js.map +1 -0
- package/dist/better-auth/plugin/types.d.ts +429 -0
- package/dist/better-auth/plugin/types.js +3 -0
- package/dist/better-auth/plugin/types.js.map +1 -0
- package/dist/better-auth/plugin/utils/set.d.ts +39 -0
- package/dist/better-auth/plugin/utils/set.js +103 -0
- package/dist/better-auth/plugin/utils/set.js.map +1 -0
- package/dist/better-auth/scripts/generate-types.d.ts +1 -0
- package/dist/better-auth/scripts/generate-types.js +234 -0
- package/dist/better-auth/scripts/generate-types.js.map +1 -0
- package/dist/better-auth/types.d.ts +2 -0
- package/dist/better-auth/types.js +4 -0
- package/dist/better-auth/types.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/shared/components/icons.d.ts +7 -0
- package/dist/shared/components/icons.js +442 -0
- package/dist/shared/components/icons.js.map +1 -0
- package/dist/shared/components/logo.d.ts +3 -0
- package/dist/shared/components/logo.js +24 -0
- package/dist/shared/components/logo.js.map +1 -0
- package/dist/shared/form/components/submit.d.ts +7 -0
- package/dist/shared/form/components/submit.js +16 -0
- package/dist/shared/form/components/submit.js.map +1 -0
- package/dist/shared/form/fields/text-field.d.ts +8 -0
- package/dist/shared/form/fields/text-field.js +37 -0
- package/dist/shared/form/fields/text-field.js.map +1 -0
- package/dist/shared/form/index.d.ts +4 -0
- package/dist/shared/form/index.js +8 -0
- package/dist/shared/form/index.js.map +1 -0
- package/dist/shared/form/ui/header/index.d.ts +8 -0
- package/dist/shared/form/ui/header/index.js +24 -0
- package/dist/shared/form/ui/header/index.js.map +1 -0
- package/dist/shared/form/ui/index.d.ts +31 -0
- package/dist/shared/form/ui/index.js +57 -0
- package/dist/shared/form/ui/index.js.map +1 -0
- package/dist/shared/form/validation.d.ts +51 -0
- package/dist/shared/form/validation.js +127 -0
- package/dist/shared/form/validation.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/payload/fields/field-copy-button/index.d.ts +3 -0
- package/dist/shared/payload/fields/field-copy-button/index.js +38 -0
- package/dist/shared/payload/fields/field-copy-button/index.js.map +1 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.d.ts +3 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.js +26 -0
- package/dist/shared/payload/fields/generate-uuid-button/index.js.map +1 -0
- package/dist/shared/payload/fields/index.d.ts +2 -0
- package/dist/shared/payload/fields/index.js +4 -0
- package/dist/shared/payload/fields/index.js.map +1 -0
- package/dist/shared/utils/regex.d.ts +2 -0
- package/dist/shared/utils/regex.js +4 -0
- package/dist/shared/utils/regex.js.map +1 -0
- package/dist/shared/utils/try-catch.d.ts +11 -0
- package/dist/shared/utils/try-catch.js +17 -0
- package/dist/shared/utils/try-catch.js.map +1 -0
- package/dist/shared/utils/value-or-default.d.ts +9 -0
- package/dist/shared/utils/value-or-default.js +12 -0
- package/dist/shared/utils/value-or-default.js.map +1 -0
- package/package.json +122 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/better-auth/plugin/payload/components/logout-button.tsx"],"sourcesContent":["'use client';\n\nimport { LogOutIcon, useConfig, useTranslation } from '@payloadcms/ui';\nimport { formatAdminURL } from 'payload/shared';\nimport React from 'react';\n\nconst baseClass = 'nav';\n\nexport const LogoutButton: React.FC<{\n tabIndex?: number;\n}> = ({ tabIndex = 0 }) => {\n const { t } = useTranslation();\n const { config } = useConfig();\n\n const {\n admin: {\n routes: { logout: logoutRoute },\n },\n routes: { admin: adminRoute },\n } = config;\n\n return (\n <a\n aria-label={t('authentication:logOut')}\n className={`${baseClass}__log-out`}\n href={formatAdminURL({\n adminRoute,\n path: logoutRoute,\n })}\n tabIndex={tabIndex}\n title={t('authentication:logOut')}\n >\n <LogOutIcon />\n </a>\n );\n};\n"],"names":["LogOutIcon","useConfig","useTranslation","formatAdminURL","React","baseClass","LogoutButton","tabIndex","t","config","admin","routes","logout","logoutRoute","adminRoute","a","aria-label","className","href","path","title"],"mappings":"AAAA;;AAEA,SAASA,UAAU,EAAEC,SAAS,EAAEC,cAAc,QAAQ,iBAAiB;AACvE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,OAAOC,WAAW,QAAQ;AAE1B,MAAMC,YAAY;AAElB,OAAO,MAAMC,eAER,CAAC,EAAEC,WAAW,CAAC,EAAE;IACpB,MAAM,EAAEC,CAAC,EAAE,GAAGN;IACd,MAAM,EAAEO,MAAM,EAAE,GAAGR;IAEnB,MAAM,EACJS,OAAO,EACLC,QAAQ,EAAEC,QAAQC,WAAW,EAAE,EAChC,EACDF,QAAQ,EAAED,OAAOI,UAAU,EAAE,EAC9B,GAAGL;IAEJ,qBACE,KAACM;QACCC,cAAYR,EAAE;QACdS,WAAW,GAAGZ,UAAU,SAAS,CAAC;QAClCa,MAAMf,eAAe;YACnBW;YACAK,MAAMN;QACR;QACAN,UAAUA;QACVa,OAAOZ,EAAE;kBAET,cAAA,KAACR;;AAGP,EAAE"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
+
import { Button, Modal, TextInput, toast, useModal } from "@payloadcms/ui";
|
|
5
|
+
import { passkeyClient } from "better-auth/client/plugins";
|
|
6
|
+
import { createAuthClient } from "better-auth/react";
|
|
7
|
+
import { X as XIcon } from "lucide-react";
|
|
8
|
+
import React, { useMemo } from "react";
|
|
9
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
const baseClass = 'passkeys-modal';
|
|
12
|
+
export const PassKeyAddButton = ({ onAdd, baseURL, basePath })=>{
|
|
13
|
+
const { openModal, closeModal } = useModal();
|
|
14
|
+
const authClient = useMemo(()=>{
|
|
15
|
+
const options = {
|
|
16
|
+
plugins: [
|
|
17
|
+
passkeyClient()
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
if (baseURL) options.baseURL = baseURL;
|
|
21
|
+
if (basePath) options.basePath = basePath;
|
|
22
|
+
return createAuthClient(options);
|
|
23
|
+
}, []);
|
|
24
|
+
const AddPasskeyForm = ()=>{
|
|
25
|
+
const nameSchema = z.object({
|
|
26
|
+
name: z.string().min(1, 'Name is required')
|
|
27
|
+
});
|
|
28
|
+
const methods = useForm({
|
|
29
|
+
defaultValues: {
|
|
30
|
+
name: ''
|
|
31
|
+
},
|
|
32
|
+
resolver: zodResolver(nameSchema),
|
|
33
|
+
mode: 'onSubmit'
|
|
34
|
+
});
|
|
35
|
+
const onSubmit = async (value)=>{
|
|
36
|
+
const res = await authClient.passkey.addPasskey({
|
|
37
|
+
name: value.name
|
|
38
|
+
});
|
|
39
|
+
if (res?.error) {
|
|
40
|
+
toast.error(res.error.message);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
toast.success('Passkey added successfully');
|
|
44
|
+
closeModal('passkeys-modal');
|
|
45
|
+
if (typeof onAdd === 'function') onAdd();
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/ _jsx(FormProvider, {
|
|
48
|
+
...methods,
|
|
49
|
+
children: /*#__PURE__*/ _jsxs("form", {
|
|
50
|
+
onSubmit: methods.handleSubmit(onSubmit),
|
|
51
|
+
className: "passkeys-add-form",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ _jsx("div", {
|
|
54
|
+
className: "passkeys-add-form__inputWrap",
|
|
55
|
+
children: /*#__PURE__*/ _jsx(TextInput, {
|
|
56
|
+
label: "Passkey Name",
|
|
57
|
+
path: "name",
|
|
58
|
+
required: true,
|
|
59
|
+
value: methods.watch('name'),
|
|
60
|
+
onChange: (e)=>methods.setValue('name', e.target.value)
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
64
|
+
type: "submit",
|
|
65
|
+
children: "Create Passkey"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
74
|
+
onClick: ()=>openModal('passkeys-modal'),
|
|
75
|
+
size: "medium",
|
|
76
|
+
buttonStyle: "pill",
|
|
77
|
+
children: "Add Passkey"
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ _jsx(Modal, {
|
|
80
|
+
slug: "passkeys-modal",
|
|
81
|
+
className: baseClass,
|
|
82
|
+
closeOnBlur: true,
|
|
83
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
84
|
+
className: `${baseClass}__wrapper`,
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
87
|
+
onClick: ()=>closeModal('passkeys-modal'),
|
|
88
|
+
buttonStyle: "icon-label",
|
|
89
|
+
size: "small",
|
|
90
|
+
className: `${baseClass}__close-button`,
|
|
91
|
+
children: /*#__PURE__*/ _jsx(XIcon, {
|
|
92
|
+
size: 24
|
|
93
|
+
})
|
|
94
|
+
}),
|
|
95
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
96
|
+
className: `${baseClass}__content`,
|
|
97
|
+
style: {
|
|
98
|
+
maxWidth: '30rem'
|
|
99
|
+
},
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
102
|
+
children: "Create New Passkey"
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ _jsx("p", {
|
|
105
|
+
children: "Securely access your account without a password by creating a new passkey."
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ _jsx(AddPasskeyForm, {})
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=add-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/add-button.tsx"],"sourcesContent":["'use client';\n\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { Button, Modal, TextInput, toast, useModal } from '@payloadcms/ui';\nimport { passkeyClient } from 'better-auth/client/plugins';\nimport { createAuthClient } from 'better-auth/react';\nimport { X as XIcon } from 'lucide-react';\nimport React, { useMemo } from 'react';\nimport { FormProvider, useForm } from 'react-hook-form';\nimport { z } from 'zod';\n\nconst baseClass = 'passkeys-modal';\n\ninterface PassKeyAddButtonProps {\n onAdd?: () => void;\n baseURL?: string;\n basePath?: string;\n}\n\nexport const PassKeyAddButton: React.FC<PassKeyAddButtonProps> = ({ onAdd, baseURL, basePath }) => {\n const { openModal, closeModal } = useModal();\n const authClient = useMemo(() => {\n const options: any = { plugins: [passkeyClient() as any] };\n if (baseURL) options.baseURL = baseURL;\n if (basePath) options.basePath = basePath;\n return createAuthClient(options);\n }, []);\n\n const AddPasskeyForm: React.FC = () => {\n const nameSchema = z.object({\n name: z.string().min(1, 'Name is required'),\n });\n\n const methods = useForm({\n defaultValues: { name: '' },\n resolver: zodResolver(nameSchema),\n mode: 'onSubmit',\n });\n\n const onSubmit = async (value: { name: string }) => {\n const res = await (authClient as any).passkey.addPasskey({ name: value.name });\n if (res?.error) {\n toast.error(res.error.message);\n return;\n }\n toast.success('Passkey added successfully');\n closeModal('passkeys-modal');\n if (typeof onAdd === 'function') onAdd();\n };\n\n return (\n <FormProvider {...methods}>\n <form onSubmit={methods.handleSubmit(onSubmit)} className='passkeys-add-form'>\n <div className='passkeys-add-form__inputWrap'>\n <TextInput\n label='Passkey Name'\n path='name'\n required\n value={methods.watch('name')}\n onChange={(e: any) => methods.setValue('name', e.target.value)}\n />\n </div>\n <Button type='submit'>Create Passkey</Button>\n </form>\n </FormProvider>\n );\n };\n\n return (\n <>\n <Button onClick={() => openModal('passkeys-modal')} size='medium' buttonStyle='pill'>\n Add Passkey\n </Button>\n <Modal slug='passkeys-modal' className={baseClass} closeOnBlur>\n <div className={`${baseClass}__wrapper`}>\n <Button\n onClick={() => closeModal('passkeys-modal')}\n buttonStyle='icon-label'\n size='small'\n className={`${baseClass}__close-button`}\n >\n <XIcon size={24} />\n </Button>\n <div className={`${baseClass}__content`} style={{ maxWidth: '30rem' }}>\n <h2>Create New Passkey</h2>\n <p>Securely access your account without a password by creating a new passkey.</p>\n <AddPasskeyForm />\n </div>\n </div>\n </Modal>\n </>\n );\n};\n"],"names":["zodResolver","Button","Modal","TextInput","toast","useModal","passkeyClient","createAuthClient","X","XIcon","React","useMemo","FormProvider","useForm","z","baseClass","PassKeyAddButton","onAdd","baseURL","basePath","openModal","closeModal","authClient","options","plugins","AddPasskeyForm","nameSchema","object","name","string","min","methods","defaultValues","resolver","mode","onSubmit","value","res","passkey","addPasskey","error","message","success","form","handleSubmit","className","div","label","path","required","watch","onChange","e","setValue","target","type","onClick","size","buttonStyle","slug","closeOnBlur","style","maxWidth","h2","p"],"mappings":"AAAA;;AAEA,SAASA,WAAW,QAAQ,0BAA0B;AACtD,SAASC,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,iBAAiB;AAC3E,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAKC,KAAK,QAAQ,eAAe;AAC1C,OAAOC,SAASC,OAAO,QAAQ,QAAQ;AACvC,SAASC,YAAY,EAAEC,OAAO,QAAQ,kBAAkB;AACxD,SAASC,CAAC,QAAQ,MAAM;AAExB,MAAMC,YAAY;AAQlB,OAAO,MAAMC,mBAAoD,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAE;IAC5F,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAGhB;IAClC,MAAMiB,aAAaX,QAAQ;QACzB,MAAMY,UAAe;YAAEC,SAAS;gBAAClB;aAAuB;QAAC;QACzD,IAAIY,SAASK,QAAQL,OAAO,GAAGA;QAC/B,IAAIC,UAAUI,QAAQJ,QAAQ,GAAGA;QACjC,OAAOZ,iBAAiBgB;IAC1B,GAAG,EAAE;IAEL,MAAME,iBAA2B;QAC/B,MAAMC,aAAaZ,EAAEa,MAAM,CAAC;YAC1BC,MAAMd,EAAEe,MAAM,GAAGC,GAAG,CAAC,GAAG;QAC1B;QAEA,MAAMC,UAAUlB,QAAQ;YACtBmB,eAAe;gBAAEJ,MAAM;YAAG;YAC1BK,UAAUjC,YAAY0B;YACtBQ,MAAM;QACR;QAEA,MAAMC,WAAW,OAAOC;YACtB,MAAMC,MAAM,MAAM,AAACf,WAAmBgB,OAAO,CAACC,UAAU,CAAC;gBAAEX,MAAMQ,MAAMR,IAAI;YAAC;YAC5E,IAAIS,KAAKG,OAAO;gBACdpC,MAAMoC,KAAK,CAACH,IAAIG,KAAK,CAACC,OAAO;gBAC7B;YACF;YACArC,MAAMsC,OAAO,CAAC;YACdrB,WAAW;YACX,IAAI,OAAOJ,UAAU,YAAYA;QACnC;QAEA,qBACE,KAACL;YAAc,GAAGmB,OAAO;sBACvB,cAAA,MAACY;gBAAKR,UAAUJ,QAAQa,YAAY,CAACT;gBAAWU,WAAU;;kCACxD,KAACC;wBAAID,WAAU;kCACb,cAAA,KAAC1C;4BACC4C,OAAM;4BACNC,MAAK;4BACLC,QAAQ;4BACRb,OAAOL,QAAQmB,KAAK,CAAC;4BACrBC,UAAU,CAACC,IAAWrB,QAAQsB,QAAQ,CAAC,QAAQD,EAAEE,MAAM,CAAClB,KAAK;;;kCAGjE,KAACnC;wBAAOsD,MAAK;kCAAS;;;;;IAI9B;IAEA,qBACE;;0BACE,KAACtD;gBAAOuD,SAAS,IAAMpC,UAAU;gBAAmBqC,MAAK;gBAASC,aAAY;0BAAO;;0BAGrF,KAACxD;gBAAMyD,MAAK;gBAAiBd,WAAW9B;gBAAW6C,WAAW;0BAC5D,cAAA,MAACd;oBAAID,WAAW,GAAG9B,UAAU,SAAS,CAAC;;sCACrC,KAACd;4BACCuD,SAAS,IAAMnC,WAAW;4BAC1BqC,aAAY;4BACZD,MAAK;4BACLZ,WAAW,GAAG9B,UAAU,cAAc,CAAC;sCAEvC,cAAA,KAACN;gCAAMgD,MAAM;;;sCAEf,MAACX;4BAAID,WAAW,GAAG9B,UAAU,SAAS,CAAC;4BAAE8C,OAAO;gCAAEC,UAAU;4BAAQ;;8CAClE,KAACC;8CAAG;;8CACJ,KAACC;8CAAE;;8CACH,KAACvC;;;;;;;;AAMb,EAAE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useConfig } from "@payloadcms/ui";
|
|
4
|
+
import React, { useState, useEffect, useCallback } from "react";
|
|
5
|
+
import { PassKeyAddButton } from "./add-button";
|
|
6
|
+
import { PasskeyList } from "./list";
|
|
7
|
+
export const PasskeysClient = ({ initialPasskeys, documentId, currentUserId, passkeySlug, passkeyUserIdFieldName, baseURL, basePath })=>{
|
|
8
|
+
const { config: { routes: { api: apiRoute } } } = useConfig();
|
|
9
|
+
const [passkeys, setPasskeys] = useState(initialPasskeys);
|
|
10
|
+
const fetchPasskeys = useCallback(async ()=>{
|
|
11
|
+
const url = `${apiRoute}/${passkeySlug}?where[${passkeyUserIdFieldName}][equals]=${documentId}`;
|
|
12
|
+
const res = await fetch(url, {
|
|
13
|
+
credentials: 'include'
|
|
14
|
+
});
|
|
15
|
+
if (!res.ok) return;
|
|
16
|
+
const data = await res.json();
|
|
17
|
+
setPasskeys(data.docs);
|
|
18
|
+
}, [
|
|
19
|
+
apiRoute,
|
|
20
|
+
passkeySlug,
|
|
21
|
+
passkeyUserIdFieldName,
|
|
22
|
+
documentId
|
|
23
|
+
]);
|
|
24
|
+
useEffect(()=>{
|
|
25
|
+
void fetchPasskeys();
|
|
26
|
+
}, [
|
|
27
|
+
fetchPasskeys
|
|
28
|
+
]);
|
|
29
|
+
const handleDelete = useCallback(async (id)=>{
|
|
30
|
+
const res = await fetch(`${apiRoute}/${passkeySlug}/${id}`, {
|
|
31
|
+
method: 'DELETE',
|
|
32
|
+
credentials: 'include'
|
|
33
|
+
});
|
|
34
|
+
if (!res.ok) return;
|
|
35
|
+
void fetchPasskeys();
|
|
36
|
+
}, [
|
|
37
|
+
apiRoute,
|
|
38
|
+
passkeySlug,
|
|
39
|
+
fetchPasskeys
|
|
40
|
+
]);
|
|
41
|
+
const handleAdd = useCallback(()=>{
|
|
42
|
+
void fetchPasskeys();
|
|
43
|
+
}, [
|
|
44
|
+
fetchPasskeys
|
|
45
|
+
]);
|
|
46
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ _jsx(PasskeyList, {
|
|
49
|
+
passkeys: passkeys,
|
|
50
|
+
onDelete: handleDelete
|
|
51
|
+
}),
|
|
52
|
+
currentUserId === documentId && (()=>{
|
|
53
|
+
const props = {
|
|
54
|
+
onAdd: handleAdd
|
|
55
|
+
};
|
|
56
|
+
if (baseURL) props.baseURL = baseURL;
|
|
57
|
+
if (basePath) props.basePath = basePath;
|
|
58
|
+
return /*#__PURE__*/ _jsx(PassKeyAddButton, {
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
})()
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/client.tsx"],"sourcesContent":["'use client';\n\nimport { useConfig } from '@payloadcms/ui';\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PassKeyAddButton } from './add-button';\nimport { PasskeyList } from './list';\nimport type { PasskeyWithId, PasskeysClientComponentProps } from './types';\n\nexport const PasskeysClient: React.FC<PasskeysClientComponentProps> = ({\n initialPasskeys,\n documentId,\n currentUserId,\n passkeySlug,\n passkeyUserIdFieldName,\n baseURL,\n basePath,\n}) => {\n const {\n config: {\n routes: { api: apiRoute },\n },\n } = useConfig();\n\n const [passkeys, setPasskeys] = useState<PasskeyWithId[]>(initialPasskeys);\n\n const fetchPasskeys = useCallback(async () => {\n const url = `${apiRoute}/${passkeySlug}?where[${passkeyUserIdFieldName}][equals]=${documentId}`;\n const res = await fetch(url, { credentials: 'include' });\n if (!res.ok) return;\n const data = (await res.json()) as { docs: PasskeyWithId[] };\n setPasskeys(data.docs);\n }, [apiRoute, passkeySlug, passkeyUserIdFieldName, documentId]);\n\n useEffect(() => {\n void fetchPasskeys();\n }, [fetchPasskeys]);\n\n const handleDelete = useCallback(\n async (id: string) => {\n const res = await fetch(`${apiRoute}/${passkeySlug}/${id}`, {\n method: 'DELETE',\n credentials: 'include',\n });\n if (!res.ok) return;\n void fetchPasskeys();\n },\n [apiRoute, passkeySlug, fetchPasskeys]\n );\n\n const handleAdd = useCallback(() => {\n void fetchPasskeys();\n }, [fetchPasskeys]);\n\n return (\n <>\n <PasskeyList passkeys={passkeys} onDelete={handleDelete} />\n {currentUserId === documentId &&\n (() => {\n const props: any = { onAdd: handleAdd };\n if (baseURL) props.baseURL = baseURL;\n if (basePath) props.basePath = basePath;\n return <PassKeyAddButton {...props} />;\n })()}\n </>\n );\n};\n"],"names":["useConfig","React","useState","useEffect","useCallback","PassKeyAddButton","PasskeyList","PasskeysClient","initialPasskeys","documentId","currentUserId","passkeySlug","passkeyUserIdFieldName","baseURL","basePath","config","routes","api","apiRoute","passkeys","setPasskeys","fetchPasskeys","url","res","fetch","credentials","ok","data","json","docs","handleDelete","id","method","handleAdd","onDelete","props","onAdd"],"mappings":"AAAA;;AAEA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,OAAOC,SAASC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,QAAQ;AAChE,SAASC,gBAAgB,QAAQ,eAAe;AAChD,SAASC,WAAW,QAAQ,SAAS;AAGrC,OAAO,MAAMC,iBAAyD,CAAC,EACrEC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,sBAAsB,EACtBC,OAAO,EACPC,QAAQ,EACT;IACC,MAAM,EACJC,QAAQ,EACNC,QAAQ,EAAEC,KAAKC,QAAQ,EAAE,EAC1B,EACF,GAAGlB;IAEJ,MAAM,CAACmB,UAAUC,YAAY,GAAGlB,SAA0BM;IAE1D,MAAMa,gBAAgBjB,YAAY;QAChC,MAAMkB,MAAM,GAAGJ,SAAS,CAAC,EAAEP,YAAY,OAAO,EAAEC,uBAAuB,UAAU,EAAEH,YAAY;QAC/F,MAAMc,MAAM,MAAMC,MAAMF,KAAK;YAAEG,aAAa;QAAU;QACtD,IAAI,CAACF,IAAIG,EAAE,EAAE;QACb,MAAMC,OAAQ,MAAMJ,IAAIK,IAAI;QAC5BR,YAAYO,KAAKE,IAAI;IACvB,GAAG;QAACX;QAAUP;QAAaC;QAAwBH;KAAW;IAE9DN,UAAU;QACR,KAAKkB;IACP,GAAG;QAACA;KAAc;IAElB,MAAMS,eAAe1B,YACnB,OAAO2B;QACL,MAAMR,MAAM,MAAMC,MAAM,GAAGN,SAAS,CAAC,EAAEP,YAAY,CAAC,EAAEoB,IAAI,EAAE;YAC1DC,QAAQ;YACRP,aAAa;QACf;QACA,IAAI,CAACF,IAAIG,EAAE,EAAE;QACb,KAAKL;IACP,GACA;QAACH;QAAUP;QAAaU;KAAc;IAGxC,MAAMY,YAAY7B,YAAY;QAC5B,KAAKiB;IACP,GAAG;QAACA;KAAc;IAElB,qBACE;;0BACE,KAACf;gBAAYa,UAAUA;gBAAUe,UAAUJ;;YAC1CpB,kBAAkBD,cACjB,AAAC,CAAA;gBACC,MAAM0B,QAAa;oBAAEC,OAAOH;gBAAU;gBACtC,IAAIpB,SAASsB,MAAMtB,OAAO,GAAGA;gBAC7B,IAAIC,UAAUqB,MAAMrB,QAAQ,GAAGA;gBAC/B,qBAAO,KAACT;oBAAkB,GAAG8B,KAAK;;YACpC,CAAA;;;AAGR,EAAE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PasskeysClient } from "./client";
|
|
3
|
+
import "./index.scss";
|
|
4
|
+
export const Passkeys = async (props)=>{
|
|
5
|
+
const { id, passkeySlug, payload, passkeyUserIdFieldName, req, user, pluginOptions } = props;
|
|
6
|
+
if (!id || !passkeySlug || !passkeyUserIdFieldName) return null;
|
|
7
|
+
// Using any because PayloadCMS collection slugs are dynamic and cannot be strictly typed
|
|
8
|
+
const { docs: userPasskeys } = await payload.find({
|
|
9
|
+
// biome-ignore lint/suspicious/noExplicitAny: PayloadCMS collection slugs are dynamic
|
|
10
|
+
collection: passkeySlug,
|
|
11
|
+
where: {
|
|
12
|
+
[passkeyUserIdFieldName]: {
|
|
13
|
+
equals: id
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
limit: 100,
|
|
17
|
+
req,
|
|
18
|
+
depth: 0
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
21
|
+
className: "passkeys-field",
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ _jsx("h3", {
|
|
24
|
+
className: "passkeys-field__title",
|
|
25
|
+
style: {
|
|
26
|
+
marginBottom: '0.7rem'
|
|
27
|
+
},
|
|
28
|
+
children: "Passkeys"
|
|
29
|
+
}),
|
|
30
|
+
(()=>{
|
|
31
|
+
// Using any because PasskeysClient props structure varies by configuration
|
|
32
|
+
// biome-ignore lint/suspicious/noExplicitAny: PasskeysClient props structure varies by configuration
|
|
33
|
+
const props = {
|
|
34
|
+
initialPasskeys: userPasskeys,
|
|
35
|
+
documentId: id,
|
|
36
|
+
currentUserId: user?.id,
|
|
37
|
+
passkeySlug,
|
|
38
|
+
passkeyUserIdFieldName
|
|
39
|
+
};
|
|
40
|
+
const baseURL = pluginOptions.betterAuthOptions?.baseURL;
|
|
41
|
+
const basePath = pluginOptions.betterAuthOptions?.basePath;
|
|
42
|
+
if (baseURL) props.baseURL = baseURL;
|
|
43
|
+
if (basePath) props.basePath = basePath;
|
|
44
|
+
return /*#__PURE__*/ _jsx(PasskeysClient, {
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
})()
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/index.tsx"],"sourcesContent":["import type React from 'react';\nimport { PasskeysClient } from './client';\nimport './index.scss';\nimport type { PasskeyWithId, PasskeysServerComponentProps } from './types';\n\nexport const Passkeys: React.FC<PasskeysServerComponentProps> = async props => {\n const { id, passkeySlug, payload, passkeyUserIdFieldName, req, user, pluginOptions } = props;\n\n if (!id || !passkeySlug || !passkeyUserIdFieldName) return null;\n\n // Using any because PayloadCMS collection slugs are dynamic and cannot be strictly typed\n const { docs: userPasskeys } = (await payload.find({\n // biome-ignore lint/suspicious/noExplicitAny: PayloadCMS collection slugs are dynamic\n collection: passkeySlug as any,\n where: {\n [passkeyUserIdFieldName]: { equals: id },\n },\n limit: 100,\n req,\n depth: 0,\n })) as unknown as { docs: PasskeyWithId[] };\n\n return (\n <div className='passkeys-field'>\n <h3 className='passkeys-field__title' style={{ marginBottom: '0.7rem' }}>\n Passkeys\n </h3>\n {(() => {\n // Using any because PasskeysClient props structure varies by configuration\n // biome-ignore lint/suspicious/noExplicitAny: PasskeysClient props structure varies by configuration\n const props: any = {\n initialPasskeys: userPasskeys,\n documentId: id,\n currentUserId: user?.id,\n passkeySlug,\n passkeyUserIdFieldName,\n };\n const baseURL = pluginOptions.betterAuthOptions?.baseURL;\n const basePath = pluginOptions.betterAuthOptions?.basePath;\n if (baseURL) props.baseURL = baseURL;\n if (basePath) props.basePath = basePath;\n return <PasskeysClient {...props} />;\n })()}\n </div>\n );\n};\n"],"names":["PasskeysClient","Passkeys","props","id","passkeySlug","payload","passkeyUserIdFieldName","req","user","pluginOptions","docs","userPasskeys","find","collection","where","equals","limit","depth","div","className","h3","style","marginBottom","initialPasskeys","documentId","currentUserId","baseURL","betterAuthOptions","basePath"],"mappings":";AACA,SAASA,cAAc,QAAQ,WAAW;AAC1C,OAAO,eAAe;AAGtB,OAAO,MAAMC,WAAmD,OAAMC;IACpE,MAAM,EAAEC,EAAE,EAAEC,WAAW,EAAEC,OAAO,EAAEC,sBAAsB,EAAEC,GAAG,EAAEC,IAAI,EAAEC,aAAa,EAAE,GAAGP;IAEvF,IAAI,CAACC,MAAM,CAACC,eAAe,CAACE,wBAAwB,OAAO;IAE3D,yFAAyF;IACzF,MAAM,EAAEI,MAAMC,YAAY,EAAE,GAAI,MAAMN,QAAQO,IAAI,CAAC;QACjD,sFAAsF;QACtFC,YAAYT;QACZU,OAAO;YACL,CAACR,uBAAuB,EAAE;gBAAES,QAAQZ;YAAG;QACzC;QACAa,OAAO;QACPT;QACAU,OAAO;IACT;IAEA,qBACE,MAACC;QAAIC,WAAU;;0BACb,KAACC;gBAAGD,WAAU;gBAAwBE,OAAO;oBAAEC,cAAc;gBAAS;0BAAG;;YAGvE,CAAA;gBACA,2EAA2E;gBAC3E,qGAAqG;gBACrG,MAAMpB,QAAa;oBACjBqB,iBAAiBZ;oBACjBa,YAAYrB;oBACZsB,eAAejB,MAAML;oBACrBC;oBACAE;gBACF;gBACA,MAAMoB,UAAUjB,cAAckB,iBAAiB,EAAED;gBACjD,MAAME,WAAWnB,cAAckB,iBAAiB,EAAEC;gBAClD,IAAIF,SAASxB,MAAMwB,OAAO,GAAGA;gBAC7B,IAAIE,UAAU1B,MAAM0B,QAAQ,GAAGA;gBAC/B,qBAAO,KAAC5B;oBAAgB,GAAGE,KAAK;;YAClC,CAAA;;;AAGN,EAAE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@payloadcms/ui";
|
|
4
|
+
import { Fingerprint, Trash } from "lucide-react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
export const PasskeyList = ({ passkeys, onDelete })=>{
|
|
7
|
+
if (passkeys.length === 0) return /*#__PURE__*/ _jsx("p", {
|
|
8
|
+
style: {
|
|
9
|
+
marginBottom: '1rem'
|
|
10
|
+
},
|
|
11
|
+
children: "No passkeys found."
|
|
12
|
+
});
|
|
13
|
+
return /*#__PURE__*/ _jsx("ul", {
|
|
14
|
+
className: "passkeys-field__list",
|
|
15
|
+
children: passkeys.map((pk)=>{
|
|
16
|
+
const { id, createdAt } = pk;
|
|
17
|
+
if (!id || !createdAt) return null;
|
|
18
|
+
return /*#__PURE__*/ _jsxs("li", {
|
|
19
|
+
className: "passkeys-field__list-item",
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(Fingerprint, {
|
|
22
|
+
size: 16
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ _jsx("span", {
|
|
25
|
+
children: pk.name || 'My Passkey'
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ _jsx("span", {
|
|
28
|
+
className: "passkeys-field__list-item-date",
|
|
29
|
+
children: " - "
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ _jsx("span", {
|
|
32
|
+
className: "passkeys-field__list-item-date",
|
|
33
|
+
children: new Date(createdAt).toLocaleString('en-US', {
|
|
34
|
+
month: 'long',
|
|
35
|
+
day: 'numeric',
|
|
36
|
+
year: 'numeric',
|
|
37
|
+
hour: 'numeric',
|
|
38
|
+
minute: '2-digit',
|
|
39
|
+
hour12: true
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
onDelete && /*#__PURE__*/ _jsx(Button, {
|
|
43
|
+
buttonStyle: "none",
|
|
44
|
+
size: "small",
|
|
45
|
+
className: "passkeys-field__delete-button",
|
|
46
|
+
onClick: ()=>onDelete(id),
|
|
47
|
+
children: /*#__PURE__*/ _jsx(Trash, {
|
|
48
|
+
size: 16
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}, id);
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/list.tsx"],"sourcesContent":["'use client';\n\nimport { Button } from '@payloadcms/ui';\nimport { Fingerprint, Trash } from 'lucide-react';\nimport React from 'react';\nimport type { PasskeyWithId } from './types';\n\ninterface PasskeyListProps {\n passkeys: PasskeyWithId[];\n onDelete?: (id: string) => void;\n}\n\nexport const PasskeyList: React.FC<PasskeyListProps> = ({ passkeys, onDelete }) => {\n if (passkeys.length === 0) return <p style={{ marginBottom: '1rem' }}>No passkeys found.</p>;\n\n return (\n <ul className='passkeys-field__list'>\n {passkeys.map(pk => {\n const { id, createdAt } = pk;\n if (!id || !createdAt) return null;\n return (\n <li key={id} className='passkeys-field__list-item'>\n <Fingerprint size={16} />\n <span>{pk.name || 'My Passkey'}</span>\n <span className='passkeys-field__list-item-date'> - </span>\n <span className='passkeys-field__list-item-date'>\n {new Date(createdAt).toLocaleString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n })}\n </span>\n {onDelete && (\n <Button\n buttonStyle='none'\n size='small'\n className='passkeys-field__delete-button'\n onClick={() => onDelete(id)}\n >\n <Trash size={16} />\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n );\n};\n"],"names":["Button","Fingerprint","Trash","React","PasskeyList","passkeys","onDelete","length","p","style","marginBottom","ul","className","map","pk","id","createdAt","li","size","span","name","Date","toLocaleString","month","day","year","hour","minute","hour12","buttonStyle","onClick"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,iBAAiB;AACxC,SAASC,WAAW,EAAEC,KAAK,QAAQ,eAAe;AAClD,OAAOC,WAAW,QAAQ;AAQ1B,OAAO,MAAMC,cAA0C,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;IAC5E,IAAID,SAASE,MAAM,KAAK,GAAG,qBAAO,KAACC;QAAEC,OAAO;YAAEC,cAAc;QAAO;kBAAG;;IAEtE,qBACE,KAACC;QAAGC,WAAU;kBACXP,SAASQ,GAAG,CAACC,CAAAA;YACZ,MAAM,EAAEC,EAAE,EAAEC,SAAS,EAAE,GAAGF;YAC1B,IAAI,CAACC,MAAM,CAACC,WAAW,OAAO;YAC9B,qBACE,MAACC;gBAAYL,WAAU;;kCACrB,KAACX;wBAAYiB,MAAM;;kCACnB,KAACC;kCAAML,GAAGM,IAAI,IAAI;;kCAClB,KAACD;wBAAKP,WAAU;kCAAiC;;kCACjD,KAACO;wBAAKP,WAAU;kCACb,IAAIS,KAAKL,WAAWM,cAAc,CAAC,SAAS;4BAC3CC,OAAO;4BACPC,KAAK;4BACLC,MAAM;4BACNC,MAAM;4BACNC,QAAQ;4BACRC,QAAQ;wBACV;;oBAEDtB,0BACC,KAACN;wBACC6B,aAAY;wBACZX,MAAK;wBACLN,WAAU;wBACVkB,SAAS,IAAMxB,SAASS;kCAExB,cAAA,KAACb;4BAAMgB,MAAM;;;;eArBVH;QA0Bb;;AAGN,EAAE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Passkey } from '@/better-auth/generated-types';
|
|
2
|
+
import type { BetterAuthPluginOptions, BuiltBetterAuthSchema } from '@/better-auth/types';
|
|
3
|
+
import type { UIFieldServerProps } from 'payload';
|
|
4
|
+
export type PasskeyWithId = Passkey & {
|
|
5
|
+
id: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
};
|
|
8
|
+
export type PasskeysServerComponentProps = UIFieldServerProps & {
|
|
9
|
+
schema: BuiltBetterAuthSchema;
|
|
10
|
+
passkeySlug: string;
|
|
11
|
+
passkeyUserIdFieldName: string;
|
|
12
|
+
pluginOptions: BetterAuthPluginOptions;
|
|
13
|
+
};
|
|
14
|
+
export type PasskeysClientComponentProps = {
|
|
15
|
+
initialPasskeys: PasskeyWithId[];
|
|
16
|
+
documentId: string | number;
|
|
17
|
+
currentUserId: string | number;
|
|
18
|
+
passkeySlug: string;
|
|
19
|
+
passkeyUserIdFieldName: string;
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
basePath?: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/passkeys/types.ts"],"sourcesContent":["import type { Passkey } from '@/better-auth/generated-types';\nimport type { BetterAuthPluginOptions, BuiltBetterAuthSchema } from '@/better-auth/types';\nimport type { UIFieldServerProps } from 'payload';\n\nexport type PasskeyWithId = Passkey & { id: string; createdAt: Date };\n\nexport type PasskeysServerComponentProps = UIFieldServerProps & {\n schema: BuiltBetterAuthSchema;\n passkeySlug: string;\n passkeyUserIdFieldName: string;\n pluginOptions: BetterAuthPluginOptions;\n};\n\nexport type PasskeysClientComponentProps = {\n initialPasskeys: PasskeyWithId[];\n documentId: string | number;\n currentUserId: string | number;\n passkeySlug: string;\n passkeyUserIdFieldName: string;\n baseURL?: string;\n basePath?: string;\n};\n"],"names":[],"mappings":"AAaA,WAQE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/better-auth/plugin/payload/components/rsc-redirect.tsx"],"sourcesContent":["import { redirect } from 'next/navigation';\nimport type React from 'react';\n\ntype RSCRedirectProps = {\n redirectTo: string;\n};\n\nconst RSCRedirect: React.FC<RSCRedirectProps> = ({ redirectTo }) => {\n redirect(redirectTo);\n};\n\nexport default RSCRedirect;\n"],"names":["redirect","RSCRedirect","redirectTo"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,kBAAkB;AAO3C,MAAMC,cAA0C,CAAC,EAAEC,UAAU,EAAE;IAC7DF,SAASE;AACX;AAEA,eAAeD,YAAY"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LoginMethod } from '@/better-auth/plugin/types';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
type AdminSocialProviderButtonsProps = {
|
|
5
|
+
isSignup: boolean;
|
|
6
|
+
loginMethods: LoginMethod[];
|
|
7
|
+
setLoading: (loading: boolean) => void;
|
|
8
|
+
redirectUrl?: string;
|
|
9
|
+
newUserCallbackURL?: string;
|
|
10
|
+
adminInviteToken?: string;
|
|
11
|
+
baseURL?: string;
|
|
12
|
+
basePath?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const AdminSocialProviderButtons: React.FC<AdminSocialProviderButtonsProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { socialProviders } from "@/better-auth/plugin/constants";
|
|
4
|
+
import { Button, toast } from "@payloadcms/ui";
|
|
5
|
+
import { passkeyClient } from "better-auth/client/plugins";
|
|
6
|
+
import { createAuthClient } from "better-auth/react";
|
|
7
|
+
import { Key } from "lucide-react";
|
|
8
|
+
import { useRouter } from "next/navigation";
|
|
9
|
+
import { useMemo } from "react";
|
|
10
|
+
import "./index.scss";
|
|
11
|
+
const baseClass = 'admin-social-provider-buttons';
|
|
12
|
+
export const AdminSocialProviderButtons = ({ isSignup, loginMethods, setLoading, redirectUrl, newUserCallbackURL, adminInviteToken, baseURL, basePath })=>{
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const authClient = useMemo(()=>{
|
|
15
|
+
// Using any because BetterAuth client options structure varies by plugin configuration
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
const options = {
|
|
18
|
+
plugins: [
|
|
19
|
+
passkeyClient()
|
|
20
|
+
]
|
|
21
|
+
};
|
|
22
|
+
if (baseURL) options.baseURL = baseURL;
|
|
23
|
+
if (basePath) options.basePath = basePath;
|
|
24
|
+
return createAuthClient(options);
|
|
25
|
+
}, []);
|
|
26
|
+
const loginMethodCount = loginMethods.filter((method)=>method !== 'emailPassword', 'passkey').length;
|
|
27
|
+
if (loginMethodCount === 0) return null;
|
|
28
|
+
const showIconOnly = loginMethodCount >= 3;
|
|
29
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
30
|
+
children: [
|
|
31
|
+
loginMethods.includes('emailPassword') && /*#__PURE__*/ _jsx("div", {
|
|
32
|
+
style: {
|
|
33
|
+
textAlign: 'center',
|
|
34
|
+
fontSize: '0.875rem',
|
|
35
|
+
textTransform: 'uppercase',
|
|
36
|
+
marginTop: '-.5rem',
|
|
37
|
+
color: 'var(--theme-elevation-450)',
|
|
38
|
+
marginBottom: '1.5rem'
|
|
39
|
+
},
|
|
40
|
+
children: /*#__PURE__*/ _jsxs("span", {
|
|
41
|
+
children: [
|
|
42
|
+
"Or ",
|
|
43
|
+
isSignup ? 'sign up' : 'login',
|
|
44
|
+
" with"
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ _jsx("div", {
|
|
49
|
+
className: `${baseClass} ${baseClass}--count-${showIconOnly ? 'many' : loginMethodCount}`,
|
|
50
|
+
children: loginMethods.map((loginMethod)=>{
|
|
51
|
+
const providerName = loginMethod.charAt(0).toUpperCase() + loginMethod.slice(1);
|
|
52
|
+
const isSocialProvider = socialProviders.includes(loginMethod);
|
|
53
|
+
// ---- Passkey ----
|
|
54
|
+
if (loginMethod === 'passkey') {
|
|
55
|
+
if (isSignup) return null;
|
|
56
|
+
const handlePasskeyClick = async ()=>{
|
|
57
|
+
setLoading(true);
|
|
58
|
+
try {
|
|
59
|
+
// Using any because BetterAuth signIn methods have dynamic types that vary by plugin
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
61
|
+
await authClient.signIn.passkey({
|
|
62
|
+
fetchOptions: {
|
|
63
|
+
onSuccess () {
|
|
64
|
+
if (router && redirectUrl) router.push(redirectUrl);
|
|
65
|
+
},
|
|
66
|
+
// Using any because BetterAuth error context types vary by operation
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
onError (context) {
|
|
69
|
+
toast.error(context.error.message || 'Failed to sign in with passkey');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
+
} catch (error) {
|
|
75
|
+
// Using any because error types vary and cannot be strictly typed
|
|
76
|
+
toast.error(error?.message ?? 'Failed to sign in with passkey');
|
|
77
|
+
} finally{
|
|
78
|
+
setLoading(false);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/ _jsxs(Button, {
|
|
82
|
+
type: "button",
|
|
83
|
+
size: "large",
|
|
84
|
+
className: `${baseClass}__button provider--passkey`,
|
|
85
|
+
onClick: handlePasskeyClick,
|
|
86
|
+
icon: showIconOnly ? /*#__PURE__*/ _jsx(Key, {
|
|
87
|
+
className: `${baseClass}__icon`
|
|
88
|
+
}) : undefined,
|
|
89
|
+
...showIconOnly ? {
|
|
90
|
+
tooltip: `Sign in with ${providerName}`
|
|
91
|
+
} : {},
|
|
92
|
+
children: [
|
|
93
|
+
!showIconOnly && /*#__PURE__*/ _jsx(Key, {
|
|
94
|
+
className: `${baseClass}__icon`
|
|
95
|
+
}),
|
|
96
|
+
!showIconOnly && /*#__PURE__*/ _jsx("span", {
|
|
97
|
+
children: providerName
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
}, loginMethod);
|
|
101
|
+
}
|
|
102
|
+
// ---- Social providers ----
|
|
103
|
+
if (isSocialProvider) {
|
|
104
|
+
const handleSocialClick = async ()=>{
|
|
105
|
+
setLoading(true);
|
|
106
|
+
try {
|
|
107
|
+
// Using any because BetterAuth signIn methods have dynamic types that vary by plugin
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
+
const res = await authClient.signIn.social({
|
|
110
|
+
provider: loginMethod,
|
|
111
|
+
fetchOptions: {
|
|
112
|
+
query: {
|
|
113
|
+
...isSignup && {
|
|
114
|
+
adminInviteToken
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
errorCallbackURL: window.location.href,
|
|
119
|
+
callbackURL: redirectUrl,
|
|
120
|
+
newUserCallbackURL,
|
|
121
|
+
...isSignup && {
|
|
122
|
+
requestSignUp: true
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (res?.error) {
|
|
126
|
+
toast.error(res.error.message);
|
|
127
|
+
}
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
129
|
+
} catch (error) {
|
|
130
|
+
// Using any because error types vary and cannot be strictly typed
|
|
131
|
+
toast.error(`Failed to sign in with ${providerName}`);
|
|
132
|
+
} finally{
|
|
133
|
+
setLoading(false);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
137
|
+
type: "button",
|
|
138
|
+
size: "large",
|
|
139
|
+
className: `${baseClass}__button provider--${loginMethod}`,
|
|
140
|
+
onClick: handleSocialClick,
|
|
141
|
+
...showIconOnly ? {
|
|
142
|
+
tooltip: `Sign in with ${providerName}`
|
|
143
|
+
} : {},
|
|
144
|
+
children: !showIconOnly && /*#__PURE__*/ _jsx("span", {
|
|
145
|
+
children: providerName
|
|
146
|
+
})
|
|
147
|
+
}, loginMethod);
|
|
148
|
+
}
|
|
149
|
+
// Unknown provider — render nothing
|
|
150
|
+
return null;
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/better-auth/plugin/payload/components/social-provider-buttons/index.tsx"],"sourcesContent":["'use client';\n\nimport { socialProviders } from '@/better-auth/plugin/constants';\nimport type { LoginMethod, SocialProvider } from '@/better-auth/plugin/types';\nimport { Button, toast } from '@payloadcms/ui';\nimport { passkeyClient } from 'better-auth/client/plugins';\nimport { createAuthClient } from 'better-auth/react';\nimport { Key } from 'lucide-react';\nimport { useRouter } from 'next/navigation';\nimport type React from 'react';\nimport { useMemo } from 'react';\nimport './index.scss';\n\ntype AdminSocialProviderButtonsProps = {\n isSignup: boolean;\n loginMethods: LoginMethod[];\n setLoading: (loading: boolean) => void;\n redirectUrl?: string;\n newUserCallbackURL?: string;\n adminInviteToken?: string;\n baseURL?: string;\n basePath?: string;\n};\n\nconst baseClass = 'admin-social-provider-buttons';\n\nexport const AdminSocialProviderButtons: React.FC<AdminSocialProviderButtonsProps> = ({\n isSignup,\n loginMethods,\n setLoading,\n redirectUrl,\n newUserCallbackURL,\n adminInviteToken,\n baseURL,\n basePath,\n}) => {\n const router = useRouter();\n const authClient = useMemo(() => {\n // Using any because BetterAuth client options structure varies by plugin configuration\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const options: any = { plugins: [passkeyClient() as any] };\n if (baseURL) options.baseURL = baseURL;\n if (basePath) options.basePath = basePath;\n return createAuthClient(options);\n }, []);\n\n const loginMethodCount = loginMethods.filter(\n method => method !== 'emailPassword',\n 'passkey'\n ).length;\n if (loginMethodCount === 0) return null;\n\n const showIconOnly = loginMethodCount >= 3;\n\n return (\n <>\n {loginMethods.includes('emailPassword') && (\n <div\n style={{\n textAlign: 'center',\n fontSize: '0.875rem',\n textTransform: 'uppercase',\n marginTop: '-.5rem',\n color: 'var(--theme-elevation-450)',\n marginBottom: '1.5rem',\n }}\n >\n <span>Or {isSignup ? 'sign up' : 'login'} with</span>\n </div>\n )}\n <div\n className={`${baseClass} ${baseClass}--count-${showIconOnly ? 'many' : loginMethodCount}`}\n >\n {loginMethods.map(loginMethod => {\n const providerName = loginMethod.charAt(0).toUpperCase() + loginMethod.slice(1);\n const isSocialProvider = socialProviders.includes(loginMethod as SocialProvider);\n\n // ---- Passkey ----\n if (loginMethod === 'passkey') {\n if (isSignup) return null;\n const handlePasskeyClick = async () => {\n setLoading(true);\n try {\n // Using any because BetterAuth signIn methods have dynamic types that vary by plugin\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n await (authClient as any).signIn.passkey({\n fetchOptions: {\n onSuccess() {\n if (router && redirectUrl) router.push(redirectUrl);\n },\n // Using any because BetterAuth error context types vary by operation\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onError(context: any) {\n toast.error(context.error.message || 'Failed to sign in with passkey');\n },\n },\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n // Using any because error types vary and cannot be strictly typed\n toast.error(error?.message ?? 'Failed to sign in with passkey');\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <Button\n key={loginMethod}\n type='button'\n size='large'\n className={`${baseClass}__button provider--passkey`}\n onClick={handlePasskeyClick}\n icon={showIconOnly ? <Key className={`${baseClass}__icon`} /> : undefined}\n // Using any because PayloadCMS Button tooltip prop type varies by component version\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {...(showIconOnly ? ({ tooltip: `Sign in with ${providerName}` } as any) : {})}\n >\n {!showIconOnly && <Key className={`${baseClass}__icon`} />}\n {!showIconOnly && <span>{providerName}</span>}\n </Button>\n );\n }\n\n // ---- Social providers ----\n if (isSocialProvider) {\n const handleSocialClick = async () => {\n setLoading(true);\n try {\n // Using any because BetterAuth signIn methods have dynamic types that vary by plugin\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const res = await (authClient as any).signIn.social({\n provider: loginMethod as SocialProvider,\n fetchOptions: {\n query: {\n ...(isSignup && { adminInviteToken }),\n },\n },\n errorCallbackURL: window.location.href,\n callbackURL: redirectUrl,\n newUserCallbackURL,\n ...(isSignup && { requestSignUp: true }),\n });\n\n if (res?.error) {\n toast.error(res.error.message);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n // Using any because error types vary and cannot be strictly typed\n toast.error(`Failed to sign in with ${providerName}`);\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <Button\n key={loginMethod}\n type='button'\n size='large'\n className={`${baseClass}__button provider--${loginMethod}`}\n onClick={handleSocialClick}\n // Using any because PayloadCMS Button tooltip prop type varies by component version\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {...(showIconOnly ? ({ tooltip: `Sign in with ${providerName}` } as any) : {})}\n >\n {!showIconOnly && <span>{providerName}</span>}\n </Button>\n );\n }\n\n // Unknown provider — render nothing\n return null;\n })}\n </div>\n </>\n );\n};\n"],"names":["socialProviders","Button","toast","passkeyClient","createAuthClient","Key","useRouter","useMemo","baseClass","AdminSocialProviderButtons","isSignup","loginMethods","setLoading","redirectUrl","newUserCallbackURL","adminInviteToken","baseURL","basePath","router","authClient","options","plugins","loginMethodCount","filter","method","length","showIconOnly","includes","div","style","textAlign","fontSize","textTransform","marginTop","color","marginBottom","span","className","map","loginMethod","providerName","charAt","toUpperCase","slice","isSocialProvider","handlePasskeyClick","signIn","passkey","fetchOptions","onSuccess","push","onError","context","error","message","type","size","onClick","icon","undefined","tooltip","handleSocialClick","res","social","provider","query","errorCallbackURL","window","location","href","callbackURL","requestSignUp"],"mappings":"AAAA;;AAEA,SAASA,eAAe,QAAQ,iCAAiC;AAEjE,SAASC,MAAM,EAAEC,KAAK,QAAQ,iBAAiB;AAC/C,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,GAAG,QAAQ,eAAe;AACnC,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAO,eAAe;AAatB,MAAMC,YAAY;AAElB,OAAO,MAAMC,6BAAwE,CAAC,EACpFC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,kBAAkB,EAClBC,gBAAgB,EAChBC,OAAO,EACPC,QAAQ,EACT;IACC,MAAMC,SAASZ;IACf,MAAMa,aAAaZ,QAAQ;QACzB,uFAAuF;QACvF,8DAA8D;QAC9D,MAAMa,UAAe;YAAEC,SAAS;gBAAClB;aAAuB;QAAC;QACzD,IAAIa,SAASI,QAAQJ,OAAO,GAAGA;QAC/B,IAAIC,UAAUG,QAAQH,QAAQ,GAAGA;QACjC,OAAOb,iBAAiBgB;IAC1B,GAAG,EAAE;IAEL,MAAME,mBAAmBX,aAAaY,MAAM,CAC1CC,CAAAA,SAAUA,WAAW,iBACrB,WACAC,MAAM;IACR,IAAIH,qBAAqB,GAAG,OAAO;IAEnC,MAAMI,eAAeJ,oBAAoB;IAEzC,qBACE;;YACGX,aAAagB,QAAQ,CAAC,kCACrB,KAACC;gBACCC,OAAO;oBACLC,WAAW;oBACXC,UAAU;oBACVC,eAAe;oBACfC,WAAW;oBACXC,OAAO;oBACPC,cAAc;gBAChB;0BAEA,cAAA,MAACC;;wBAAK;wBAAI1B,WAAW,YAAY;wBAAQ;;;;0BAG7C,KAACkB;gBACCS,WAAW,GAAG7B,UAAU,CAAC,EAAEA,UAAU,QAAQ,EAAEkB,eAAe,SAASJ,kBAAkB;0BAExFX,aAAa2B,GAAG,CAACC,CAAAA;oBAChB,MAAMC,eAAeD,YAAYE,MAAM,CAAC,GAAGC,WAAW,KAAKH,YAAYI,KAAK,CAAC;oBAC7E,MAAMC,mBAAmB5C,gBAAgB2B,QAAQ,CAACY;oBAElD,oBAAoB;oBACpB,IAAIA,gBAAgB,WAAW;wBAC7B,IAAI7B,UAAU,OAAO;wBACrB,MAAMmC,qBAAqB;4BACzBjC,WAAW;4BACX,IAAI;gCACF,qFAAqF;gCACrF,8DAA8D;gCAC9D,MAAM,AAACO,WAAmB2B,MAAM,CAACC,OAAO,CAAC;oCACvCC,cAAc;wCACZC;4CACE,IAAI/B,UAAUL,aAAaK,OAAOgC,IAAI,CAACrC;wCACzC;wCACA,qEAAqE;wCACrE,8DAA8D;wCAC9DsC,SAAQC,OAAY;4CAClBlD,MAAMmD,KAAK,CAACD,QAAQC,KAAK,CAACC,OAAO,IAAI;wCACvC;oCACF;gCACF;4BACA,8DAA8D;4BAChE,EAAE,OAAOD,OAAY;gCACnB,kEAAkE;gCAClEnD,MAAMmD,KAAK,CAACA,OAAOC,WAAW;4BAChC,SAAU;gCACR1C,WAAW;4BACb;wBACF;wBAEA,qBACE,MAACX;4BAECsD,MAAK;4BACLC,MAAK;4BACLnB,WAAW,GAAG7B,UAAU,0BAA0B,CAAC;4BACnDiD,SAASZ;4BACTa,MAAMhC,6BAAe,KAACrB;gCAAIgC,WAAW,GAAG7B,UAAU,MAAM,CAAC;iCAAOmD;4BAG/D,GAAIjC,eAAgB;gCAAEkC,SAAS,CAAC,aAAa,EAAEpB,cAAc;4BAAC,IAAY,CAAC,CAAC;;gCAE5E,CAACd,8BAAgB,KAACrB;oCAAIgC,WAAW,GAAG7B,UAAU,MAAM,CAAC;;gCACrD,CAACkB,8BAAgB,KAACU;8CAAMI;;;2BAXpBD;oBAcX;oBAEA,6BAA6B;oBAC7B,IAAIK,kBAAkB;wBACpB,MAAMiB,oBAAoB;4BACxBjD,WAAW;4BACX,IAAI;gCACF,qFAAqF;gCACrF,8DAA8D;gCAC9D,MAAMkD,MAAM,MAAM,AAAC3C,WAAmB2B,MAAM,CAACiB,MAAM,CAAC;oCAClDC,UAAUzB;oCACVS,cAAc;wCACZiB,OAAO;4CACL,GAAIvD,YAAY;gDAAEK;4CAAiB,CAAC;wCACtC;oCACF;oCACAmD,kBAAkBC,OAAOC,QAAQ,CAACC,IAAI;oCACtCC,aAAazD;oCACbC;oCACA,GAAIJ,YAAY;wCAAE6D,eAAe;oCAAK,CAAC;gCACzC;gCAEA,IAAIT,KAAKT,OAAO;oCACdnD,MAAMmD,KAAK,CAACS,IAAIT,KAAK,CAACC,OAAO;gCAC/B;4BACA,8DAA8D;4BAChE,EAAE,OAAOD,OAAY;gCACnB,kEAAkE;gCAClEnD,MAAMmD,KAAK,CAAC,CAAC,uBAAuB,EAAEb,cAAc;4BACtD,SAAU;gCACR5B,WAAW;4BACb;wBACF;wBAEA,qBACE,KAACX;4BAECsD,MAAK;4BACLC,MAAK;4BACLnB,WAAW,GAAG7B,UAAU,mBAAmB,EAAE+B,aAAa;4BAC1DkB,SAASI;4BAGR,GAAInC,eAAgB;gCAAEkC,SAAS,CAAC,aAAa,EAAEpB,cAAc;4BAAC,IAAY,CAAC,CAAC;sCAE5E,CAACd,8BAAgB,KAACU;0CAAMI;;2BATpBD;oBAYX;oBAEA,oCAAoC;oBACpC,OAAO;gBACT;;;;AAIR,EAAE"}
|