@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,347 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import "./index.scss";
|
|
4
|
+
import { Button, Modal, toast, useField, useFormFields, useModal, useTranslation } from "@payloadcms/ui";
|
|
5
|
+
import { twoFactorClient } from "better-auth/client/plugins";
|
|
6
|
+
import { createAuthClient } from "better-auth/react";
|
|
7
|
+
import { Copy, XIcon } from "lucide-react";
|
|
8
|
+
import { QRCodeSVG } from "qrcode.react";
|
|
9
|
+
import React, { useMemo, useState } from "react";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { useAppForm } from "../../../../../shared/form";
|
|
12
|
+
import { Form, FormInputWrap } from "../../../../../shared/form/ui";
|
|
13
|
+
import { passwordField } from "../../../../../shared/form/validation";
|
|
14
|
+
const baseClass = "two-factor-auth-modal";
|
|
15
|
+
export function TwoFactorAuth({ baseURL, basePath }) {
|
|
16
|
+
const [totpURI, setTotpURI] = useState("");
|
|
17
|
+
const [backupCodes, setBackupCodes] = useState(null);
|
|
18
|
+
const [formState, setFormState] = useState("enable");
|
|
19
|
+
const { openModal, closeModal } = useModal();
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const twoFactorEnabledField = useFormFields(([fields])=>fields.twoFactorEnabled);
|
|
22
|
+
const twoFactorEnabled = Boolean(twoFactorEnabledField?.value);
|
|
23
|
+
const { setValue: setTwoFactorEnabled } = useField({
|
|
24
|
+
path: "twoFactorEnabled"
|
|
25
|
+
});
|
|
26
|
+
const authClient = useMemo(()=>createAuthClient({
|
|
27
|
+
baseURL,
|
|
28
|
+
basePath,
|
|
29
|
+
plugins: [
|
|
30
|
+
twoFactorClient()
|
|
31
|
+
]
|
|
32
|
+
}), []);
|
|
33
|
+
const copyURI = async ()=>{
|
|
34
|
+
if (!totpURI) return;
|
|
35
|
+
try {
|
|
36
|
+
await navigator.clipboard.writeText(totpURI);
|
|
37
|
+
toast.success("Copied");
|
|
38
|
+
} catch {
|
|
39
|
+
toast.error("Failed to copy");
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
// Form Schemas
|
|
43
|
+
const passwordSchema = z.object({
|
|
44
|
+
password: passwordField({
|
|
45
|
+
t
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
const otpSchema = z.object({
|
|
49
|
+
otp: z.string().length(6, "Code must be 6 digits").refine((val)=>/^\d{6}$/.test(val), "Code must be numeric")
|
|
50
|
+
});
|
|
51
|
+
const EnableForm = ()=>{
|
|
52
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
53
|
+
const form = useAppForm({
|
|
54
|
+
defaultValues: {
|
|
55
|
+
password: ""
|
|
56
|
+
},
|
|
57
|
+
onSubmit: async ({ value })=>{
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
const { data, error } = await authClient.twoFactor.enable({
|
|
60
|
+
password: value.password
|
|
61
|
+
});
|
|
62
|
+
setIsLoading(false);
|
|
63
|
+
if (error) {
|
|
64
|
+
toast.error(error.message);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
setTotpURI(data.totpURI);
|
|
68
|
+
if (data && "backupCodes" in data && data.backupCodes) {
|
|
69
|
+
setBackupCodes(Array.isArray(data.backupCodes) ? data.backupCodes : String(data.backupCodes).split(/\s+/).filter(Boolean));
|
|
70
|
+
} else {
|
|
71
|
+
setBackupCodes(null);
|
|
72
|
+
}
|
|
73
|
+
setFormState("verify");
|
|
74
|
+
},
|
|
75
|
+
validators: {
|
|
76
|
+
onSubmit: passwordSchema
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/ _jsxs(Form, {
|
|
80
|
+
onSubmit: (e)=>{
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
void form.handleSubmit();
|
|
83
|
+
},
|
|
84
|
+
className: "two-factor-enable-form",
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsx(FormInputWrap, {
|
|
87
|
+
className: "two-factor-enable-form__inputWrap",
|
|
88
|
+
children: /*#__PURE__*/ _jsx(form.AppField, {
|
|
89
|
+
name: "password",
|
|
90
|
+
children: (field)=>/*#__PURE__*/ _jsx(field.TextField, {
|
|
91
|
+
type: "password",
|
|
92
|
+
className: "password",
|
|
93
|
+
label: "Password",
|
|
94
|
+
required: true
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ _jsx(form.AppForm, {
|
|
99
|
+
children: /*#__PURE__*/ _jsx(form.Submit, {
|
|
100
|
+
label: "Enable",
|
|
101
|
+
loadingLabel: "Enabling"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const VerifyForm = ()=>{
|
|
108
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
109
|
+
const form = useAppForm({
|
|
110
|
+
defaultValues: {
|
|
111
|
+
otp: ""
|
|
112
|
+
},
|
|
113
|
+
onSubmit: async ({ value })=>{
|
|
114
|
+
setIsLoading(true);
|
|
115
|
+
const { data, error } = await authClient.twoFactor.verifyTotp({
|
|
116
|
+
code: value.otp
|
|
117
|
+
});
|
|
118
|
+
setIsLoading(false);
|
|
119
|
+
if (error) {
|
|
120
|
+
toast.error(error.message);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (data && "backupCodes" in data && data.backupCodes) {
|
|
124
|
+
setBackupCodes(Array.isArray(data.backupCodes) ? data.backupCodes : String(data.backupCodes).split(/\s+/).filter(Boolean));
|
|
125
|
+
}
|
|
126
|
+
toast.success("Two‑factor verified & enabled");
|
|
127
|
+
setTwoFactorEnabled(true);
|
|
128
|
+
setFormState("backupCodes");
|
|
129
|
+
},
|
|
130
|
+
validators: {
|
|
131
|
+
onSubmit: otpSchema
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return /*#__PURE__*/ _jsxs(Form, {
|
|
135
|
+
onSubmit: (e)=>{
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
void form.handleSubmit();
|
|
138
|
+
},
|
|
139
|
+
className: "two-factor-verify-form",
|
|
140
|
+
children: [
|
|
141
|
+
/*#__PURE__*/ _jsx(FormInputWrap, {
|
|
142
|
+
className: "tf__inputWrap",
|
|
143
|
+
children: /*#__PURE__*/ _jsx(form.AppField, {
|
|
144
|
+
name: "otp",
|
|
145
|
+
children: (field)=>/*#__PURE__*/ _jsx(field.TextField, {
|
|
146
|
+
type: "text",
|
|
147
|
+
className: "text otp",
|
|
148
|
+
label: "6‑digit Code",
|
|
149
|
+
required: true
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ _jsx(form.AppForm, {
|
|
154
|
+
children: /*#__PURE__*/ _jsx(form.Submit, {
|
|
155
|
+
label: "Verify",
|
|
156
|
+
loadingLabel: "Verifying"
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
const DisableForm = ()=>{
|
|
163
|
+
const form = useAppForm({
|
|
164
|
+
defaultValues: {
|
|
165
|
+
password: ""
|
|
166
|
+
},
|
|
167
|
+
onSubmit: async ({ value })=>{
|
|
168
|
+
await authClient.twoFactor.disable({
|
|
169
|
+
password: value.password
|
|
170
|
+
}, {
|
|
171
|
+
onSuccess () {
|
|
172
|
+
toast.success("Two‑factor disabled");
|
|
173
|
+
setTwoFactorEnabled(false);
|
|
174
|
+
closeModal("two-factor-auth-modal");
|
|
175
|
+
return undefined;
|
|
176
|
+
},
|
|
177
|
+
onError (ctx) {
|
|
178
|
+
toast.error(ctx.error.message);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
validators: {
|
|
183
|
+
onSubmit: passwordSchema
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
return /*#__PURE__*/ _jsxs(Form, {
|
|
187
|
+
onSubmit: (e)=>{
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
void form.handleSubmit();
|
|
190
|
+
},
|
|
191
|
+
className: "two-factor-disable-form mt-4",
|
|
192
|
+
children: [
|
|
193
|
+
/*#__PURE__*/ _jsx(FormInputWrap, {
|
|
194
|
+
className: "two-factor-disable-form__inputWrap",
|
|
195
|
+
children: /*#__PURE__*/ _jsx(form.AppField, {
|
|
196
|
+
name: "password",
|
|
197
|
+
children: (field)=>/*#__PURE__*/ _jsx(field.TextField, {
|
|
198
|
+
type: "password",
|
|
199
|
+
className: "password",
|
|
200
|
+
label: "Password",
|
|
201
|
+
required: true
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
}),
|
|
205
|
+
/*#__PURE__*/ _jsx(form.AppForm, {
|
|
206
|
+
children: /*#__PURE__*/ _jsx(form.Submit, {
|
|
207
|
+
label: "Disable Two‑Factor",
|
|
208
|
+
loadingLabel: "Disabling"
|
|
209
|
+
})
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
215
|
+
className: "two-factor-auth-field",
|
|
216
|
+
children: [
|
|
217
|
+
twoFactorEnabled ? /*#__PURE__*/ _jsx(Button, {
|
|
218
|
+
onClick: ()=>{
|
|
219
|
+
setFormState("disable");
|
|
220
|
+
openModal("two-factor-auth-modal");
|
|
221
|
+
},
|
|
222
|
+
size: "medium",
|
|
223
|
+
buttonStyle: "pill",
|
|
224
|
+
children: "Disable Two-Factor"
|
|
225
|
+
}) : /*#__PURE__*/ _jsx(Button, {
|
|
226
|
+
onClick: ()=>{
|
|
227
|
+
setFormState("enable");
|
|
228
|
+
openModal("two-factor-auth-modal");
|
|
229
|
+
},
|
|
230
|
+
size: "medium",
|
|
231
|
+
buttonStyle: "pill",
|
|
232
|
+
children: "Enable Two-Factor"
|
|
233
|
+
}),
|
|
234
|
+
/*#__PURE__*/ _jsx(Modal, {
|
|
235
|
+
slug: "two-factor-auth-modal",
|
|
236
|
+
className: baseClass,
|
|
237
|
+
closeOnBlur: true,
|
|
238
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
239
|
+
className: `${baseClass}__wrapper`,
|
|
240
|
+
children: [
|
|
241
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
242
|
+
onClick: ()=>closeModal("two-factor-auth-modal"),
|
|
243
|
+
buttonStyle: "icon-label",
|
|
244
|
+
size: "small",
|
|
245
|
+
className: `${baseClass}__close-button`,
|
|
246
|
+
children: /*#__PURE__*/ _jsx(XIcon, {
|
|
247
|
+
size: 24
|
|
248
|
+
})
|
|
249
|
+
}),
|
|
250
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
251
|
+
className: `${baseClass}__content`,
|
|
252
|
+
style: {
|
|
253
|
+
maxWidth: "38rem"
|
|
254
|
+
},
|
|
255
|
+
children: [
|
|
256
|
+
formState === "enable" && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
257
|
+
children: [
|
|
258
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
259
|
+
children: "Enable Two‑Factor"
|
|
260
|
+
}),
|
|
261
|
+
/*#__PURE__*/ _jsx(EnableForm, {})
|
|
262
|
+
]
|
|
263
|
+
}),
|
|
264
|
+
formState === "verify" && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
265
|
+
children: [
|
|
266
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
267
|
+
children: "Verify Two‑Factor"
|
|
268
|
+
}),
|
|
269
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
270
|
+
className: "two-factor-auth-modal__verify-block",
|
|
271
|
+
children: [
|
|
272
|
+
/*#__PURE__*/ _jsx("p", {
|
|
273
|
+
children: "Scan the QR code with your authenticator app or copy the URI."
|
|
274
|
+
}),
|
|
275
|
+
/*#__PURE__*/ _jsx("div", {
|
|
276
|
+
className: "two-factor-auth-modal__qrcode",
|
|
277
|
+
children: /*#__PURE__*/ _jsx(QRCodeSVG, {
|
|
278
|
+
value: totpURI,
|
|
279
|
+
size: 200
|
|
280
|
+
})
|
|
281
|
+
}),
|
|
282
|
+
/*#__PURE__*/ _jsxs(Button, {
|
|
283
|
+
size: "small",
|
|
284
|
+
buttonStyle: "transparent",
|
|
285
|
+
onClick: copyURI,
|
|
286
|
+
className: "two-factor-auth-modal__copy-btn",
|
|
287
|
+
children: [
|
|
288
|
+
/*#__PURE__*/ _jsx(Copy, {
|
|
289
|
+
size: 18,
|
|
290
|
+
className: "two-factor-auth-modal__copy-icon"
|
|
291
|
+
}),
|
|
292
|
+
" ",
|
|
293
|
+
"Copy URI"
|
|
294
|
+
]
|
|
295
|
+
}),
|
|
296
|
+
/*#__PURE__*/ _jsx(VerifyForm, {})
|
|
297
|
+
]
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
}),
|
|
301
|
+
formState === "backupCodes" && backupCodes && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
302
|
+
children: [
|
|
303
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
304
|
+
children: "Backup Codes"
|
|
305
|
+
}),
|
|
306
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
307
|
+
className: "two-factor-auth-modal__backup-codes",
|
|
308
|
+
children: [
|
|
309
|
+
/*#__PURE__*/ _jsx("ul", {
|
|
310
|
+
children: backupCodes.map((code, i)=>/*#__PURE__*/ _jsx("li", {
|
|
311
|
+
className: "two-factor-auth-modal__backup-code",
|
|
312
|
+
children: code
|
|
313
|
+
}, i))
|
|
314
|
+
}),
|
|
315
|
+
/*#__PURE__*/ _jsx("p", {
|
|
316
|
+
className: "two-factor-auth-modal__backup-desc",
|
|
317
|
+
children: "Store these codes in a safe place. Each code can be used once if you lose access to your authenticator."
|
|
318
|
+
})
|
|
319
|
+
]
|
|
320
|
+
}),
|
|
321
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
322
|
+
onClick: ()=>closeModal("two-factor-auth-modal"),
|
|
323
|
+
buttonStyle: "primary",
|
|
324
|
+
size: "large",
|
|
325
|
+
className: "two-factor-auth-modal__backup-codes-close-button",
|
|
326
|
+
children: "Saved them!"
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
}),
|
|
330
|
+
formState === "disable" && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
331
|
+
children: [
|
|
332
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
333
|
+
children: "Two‑Factor Authentication"
|
|
334
|
+
}),
|
|
335
|
+
/*#__PURE__*/ _jsx(DisableForm, {})
|
|
336
|
+
]
|
|
337
|
+
})
|
|
338
|
+
]
|
|
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JtSW5wdXRXcmFwIGNsYXNzTmFtZT1cInR3by1mYWN0b3ItZGlzYWJsZS1mb3JtX19pbnB1dFdyYXBcIj5cbiAgICAgICAgICA8Zm9ybS5BcHBGaWVsZFxuICAgICAgICAgICAgbmFtZT1cInBhc3N3b3JkXCJcbiAgICAgICAgICAgIGNoaWxkcmVuPXsoZmllbGQ6IGFueSkgPT4gKFxuICAgICAgICAgICAgICA8ZmllbGQuVGV4dEZpZWxkXG4gICAgICAgICAgICAgICAgdHlwZT1cInBhc3N3b3JkXCJcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJwYXNzd29yZFwiXG4gICAgICAgICAgICAgICAgbGFiZWw9XCJQYXNzd29yZFwiXG4gICAgICAgICAgICAgICAgcmVxdWlyZWRcbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgLz5cbiAgICAgICAgPC9Gb3JtSW5wdXRXcmFwPlxuICAgICAgICA8Zm9ybS5BcHBGb3JtXG4gICAgICAgICAgY2hpbGRyZW49e1xuICAgICAgICAgICAgPGZvcm0uU3VibWl0IGxhYmVsPVwiRGlzYWJsZSBUd2/igJFGYWN0b3JcIiBsb2FkaW5nTGFiZWw9XCJEaXNhYmxpbmdcIiAvPlxuICAgICAgICAgIH1cbiAgICAgICAgLz5cbiAgICAgIDwvRm9ybT5cbiAgICApO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9XCJ0d28tZmFjdG9yLWF1dGgtZmllbGRcIj5cbiAgICAgIHt0d29GYWN0b3JFbmFibGVkID8gKFxuICAgICAgICA8QnV0dG9uXG4gICAgICAgICAgb25DbGljaz17KCkgPT4ge1xuICAgICAgICAgICAgc2V0Rm9ybVN0YXRlKFwiZGlzYWJsZVwiKTtcbiAgICAgICAgICAgIG9wZW5Nb2RhbChcInR3by1mYWN0b3ItYXV0aC1tb2RhbFwiKTtcbiAgICAgICAgICB9fVxuICAgICAgICAgIHNpemU9XCJtZWRpdW1cIlxuICAgICAgICAgIGJ1dHRvblN0eWxlPVwicGlsbFwiXG4gICAgICAgID5cbiAgICAgICAgICBEaXNhYmxlIFR3by1GYWN0b3JcbiAgICAgICAgPC9CdXR0b24+XG4gICAgICApIDogKFxuICAgICAgICA8QnV0dG9uXG4gICAgICAgICAgb25DbGljaz17KCkgPT4ge1xuICAgICAgICAgICAgc2V0Rm9ybVN0YXRlKFwiZW5hYmxlXCIpO1xuICAgICAgICAgICAgb3Blbk1vZGFsKFwidHdvLWZhY3Rvci1hdXRoLW1vZGFsXCIpO1xuICAgICAgICAgIH19XG4gICAgICAgICAgc2l6ZT1cIm1lZGl1bVwiXG4gICAgICAgICAgYnV0dG9uU3R5bGU9XCJwaWxsXCJcbiAgICAgICAgPlxuICAgICAgICAgIEVuYWJsZSBUd28tRmFjdG9yXG4gICAgICAgIDwvQnV0dG9uPlxuICAgICAgKX1cbiAgICAgIDxNb2RhbCBzbHVnPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsXCIgY2xhc3NOYW1lPXtiYXNlQ2xhc3N9IGNsb3NlT25CbHVyPlxuICAgICAgICA8ZGl2IGNsYXNzTmFtZT17YCR7YmFzZUNsYXNzfV9fd3JhcHBlcmB9PlxuICAgICAgICAgIDxCdXR0b25cbiAgICAgICAgICAgIG9uQ2xpY2s9eygpID0+IGNsb3NlTW9kYWwoXCJ0d28tZmFjdG9yLWF1dGgtbW9kYWxcIil9XG4gICAgICAgICAgICBidXR0b25TdHlsZT1cImljb24tbGFiZWxcIlxuICAgICAgICAgICAgc2l6ZT1cInNtYWxsXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17YCR7YmFzZUNsYXNzfV9fY2xvc2UtYnV0dG9uYH1cbiAgICAgICAgICA+XG4gICAgICAgICAgICA8WEljb24gc2l6ZT17MjR9IC8+XG4gICAgICAgICAgPC9CdXR0b24+XG5cbiAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICBjbGFzc05hbWU9e2Ake2Jhc2VDbGFzc31fX2NvbnRlbnRgfVxuICAgICAgICAgICAgc3R5bGU9e3sgbWF4V2lkdGg6IFwiMzhyZW1cIiB9fVxuICAgICAgICAgID5cbiAgICAgICAgICAgIHtmb3JtU3RhdGUgPT09IFwiZW5hYmxlXCIgJiYgKFxuICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgIDxoMj5FbmFibGUgVHdv4oCRRmFjdG9yPC9oMj5cbiAgICAgICAgICAgICAgICA8RW5hYmxlRm9ybSAvPlxuICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgICB7Zm9ybVN0YXRlID09PSBcInZlcmlmeVwiICYmIChcbiAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICA8aDI+VmVyaWZ5IFR3b+KAkUZhY3RvcjwvaDI+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJ0d28tZmFjdG9yLWF1dGgtbW9kYWxfX3ZlcmlmeS1ibG9ja1wiPlxuICAgICAgICAgICAgICAgICAgPHA+XG4gICAgICAgICAgICAgICAgICAgIFNjYW4gdGhlIFFSIGNvZGUgd2l0aCB5b3VyIGF1dGhlbnRpY2F0b3IgYXBwIG9yIGNvcHkgdGhlXG4gICAgICAgICAgICAgICAgICAgIFVSSS5cbiAgICAgICAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsX19xcmNvZGVcIj5cbiAgICAgICAgICAgICAgICAgICAgPFFSQ29kZVNWRyB2YWx1ZT17dG90cFVSSX0gc2l6ZT17MjAwfSAvPlxuICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICA8QnV0dG9uXG4gICAgICAgICAgICAgICAgICAgIHNpemU9XCJzbWFsbFwiXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlPVwidHJhbnNwYXJlbnRcIlxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrPXtjb3B5VVJJfVxuICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJ0d28tZmFjdG9yLWF1dGgtbW9kYWxfX2NvcHktYnRuXCJcbiAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPENvcHlcbiAgICAgICAgICAgICAgICAgICAgICBzaXplPXsxOH1cbiAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJ0d28tZmFjdG9yLWF1dGgtbW9kYWxfX2NvcHktaWNvblwiXG4gICAgICAgICAgICAgICAgICAgIC8+e1wiIFwifVxuICAgICAgICAgICAgICAgICAgICBDb3B5IFVSSVxuICAgICAgICAgICAgICAgICAgPC9CdXR0b24+XG4gICAgICAgICAgICAgICAgICA8VmVyaWZ5Rm9ybSAvPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgICB7Zm9ybVN0YXRlID09PSBcImJhY2t1cENvZGVzXCIgJiYgYmFja3VwQ29kZXMgJiYgKFxuICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgIDxoMj5CYWNrdXAgQ29kZXM8L2gyPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsX19iYWNrdXAtY29kZXNcIj5cbiAgICAgICAgICAgICAgICAgIDx1bD5cbiAgICAgICAgICAgICAgICAgICAge2JhY2t1cENvZGVzLm1hcCgoY29kZSwgaSkgPT4gKFxuICAgICAgICAgICAgICAgICAgICAgIDxsaVxuICAgICAgICAgICAgICAgICAgICAgICAga2V5PXtpfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsX19iYWNrdXAtY29kZVwiXG4gICAgICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICAgICAge2NvZGV9XG4gICAgICAgICAgICAgICAgICAgICAgPC9saT5cbiAgICAgICAgICAgICAgICAgICAgKSl9XG4gICAgICAgICAgICAgICAgICA8L3VsPlxuICAgICAgICAgICAgICAgICAgPHAgY2xhc3NOYW1lPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsX19iYWNrdXAtZGVzY1wiPlxuICAgICAgICAgICAgICAgICAgICBTdG9yZSB0aGVzZSBjb2RlcyBpbiBhIHNhZmUgcGxhY2UuIEVhY2ggY29kZSBjYW4gYmUgdXNlZFxuICAgICAgICAgICAgICAgICAgICBvbmNlIGlmIHlvdSBsb3NlIGFjY2VzcyB0byB5b3VyIGF1dGhlbnRpY2F0b3IuXG4gICAgICAgICAgICAgICAgICA8L3A+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICAgICAgb25DbGljaz17KCkgPT4gY2xvc2VNb2RhbChcInR3by1mYWN0b3ItYXV0aC1tb2RhbFwiKX1cbiAgICAgICAgICAgICAgICAgIGJ1dHRvblN0eWxlPVwicHJpbWFyeVwiXG4gICAgICAgICAgICAgICAgICBzaXplPVwibGFyZ2VcIlxuICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lPVwidHdvLWZhY3Rvci1hdXRoLW1vZGFsX19iYWNrdXAtY29kZXMtY2xvc2UtYnV0dG9uXCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICBTYXZlZCB0aGVtIVxuICAgICAgICAgICAgICAgIDwvQnV0dG9uPlxuICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgICB7Zm9ybVN0YXRlID09PSBcImRpc2FibGVcIiAmJiAoXG4gICAgICAgICAgICAgIDw+XG4gICAgICAgICAgICAgICAgPGgyPlR3b+KAkUZhY3RvciBBdXRoZW50aWNhdGlvbjwvaDI+XG4gICAgICAgICAgICAgICAgPERpc2FibGVGb3JtIC8+XG4gICAgICAgICAgICAgIDw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lOOUQsY0FBYyxpQkFBaUJGLDZCQUM5Qjs7c0RBQ0UsS0FBQ2lGO3NEQUFHOztzREFDSixNQUFDUjs0Q0FBSXJCLFdBQVU7OzhEQUNiLEtBQUMrQjs4REFDRW5GLFlBQVlvRixHQUFHLENBQUMsQ0FBQ2xCLE1BQU1tQixrQkFDdEIsS0FBQ0M7NERBRUNsQyxXQUFVO3NFQUVUYzsyREFISW1COzs4REFPWCxLQUFDSDtvREFBRTlCLFdBQVU7OERBQXFDOzs7O3NEQUtwRCxLQUFDOUU7NENBQ0NvRyxTQUFTLElBQU1yRSxXQUFXOzRDQUMxQnVFLGFBQVk7NENBQ1pELE1BQUs7NENBQ0x2QixXQUFVO3NEQUNYOzs7O2dDQUtKbEQsY0FBYywyQkFDYjs7c0RBQ0UsS0FBQytFO3NEQUFHOztzREFDSixLQUFDZDs7Ozs7Ozs7OztBQVFqQiJ9
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@layer payload-default {
|
|
2
|
+
.two-factor-auth-modal {
|
|
3
|
+
position: fixed;
|
|
4
|
+
inset: 0;
|
|
5
|
+
z-index: 1000;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
&:before {
|
|
12
|
+
content: '';
|
|
13
|
+
position: absolute;
|
|
14
|
+
inset: 0;
|
|
15
|
+
background: rgba(0, 0, 0, 0.8);
|
|
16
|
+
z-index: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__wrapper {
|
|
20
|
+
z-index: 1;
|
|
21
|
+
position: relative;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
gap: 16px;
|
|
25
|
+
border-radius: 3px;
|
|
26
|
+
border: 1px solid var(--theme-border-color);
|
|
27
|
+
background-color: var(--theme-elevation-50);
|
|
28
|
+
min-width: 340px;
|
|
29
|
+
max-width: 90vw;
|
|
30
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__close-button {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
margin-block: 0 !important;
|
|
38
|
+
padding: 10px !important;
|
|
39
|
+
|
|
40
|
+
svg {
|
|
41
|
+
width: 24px;
|
|
42
|
+
height: 24px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__content {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 1.5rem;
|
|
50
|
+
padding: 1.5rem 1.5rem 1rem 1.5rem;
|
|
51
|
+
|
|
52
|
+
h2 {
|
|
53
|
+
font-size: 1.5rem;
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
margin: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
p {
|
|
59
|
+
margin: 0;
|
|
60
|
+
color: var(--theme-elevation-500);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__verify-block {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
gap: 1.5rem;
|
|
68
|
+
margin-top: 1.5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__backup-codes {
|
|
72
|
+
>ul {
|
|
73
|
+
padding: 1rem;
|
|
74
|
+
background-color: var(--theme-elevation-50);
|
|
75
|
+
border: 1px solid var(--theme-elevation-100);
|
|
76
|
+
border-radius: 4px;
|
|
77
|
+
columns: 2;
|
|
78
|
+
font-family: monospace;
|
|
79
|
+
margin-bottom: 1rem;
|
|
80
|
+
list-style: none;
|
|
81
|
+
text-align: center;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__qrcode {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
margin-bottom: 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__uri {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 0.5rem;
|
|
96
|
+
border-radius: 3px;
|
|
97
|
+
background: var(--theme-elevation-100, #f3f3f3);
|
|
98
|
+
padding: 0.5rem 1rem;
|
|
99
|
+
font-size: 0.95em;
|
|
100
|
+
word-break: break-all;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__copy-btn {
|
|
104
|
+
margin-block: 0.5rem;
|
|
105
|
+
margin-inline: auto;
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: 0.5rem;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&__copy-icon {
|
|
112
|
+
margin-right: 0.25rem;
|
|
113
|
+
vertical-align: middle;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AdminButtons } from "../components/admin-buttons";
|
|
2
|
+
import { AdminInviteButton } from "../components/admin-invite-button";
|
|
3
|
+
import { AlternativeMethods, CredentialsForm, LoginFormProvider, useLoginForm } from "../components/login-form";
|
|
4
|
+
import { LogoutButton } from "../components/logout-button";
|
|
5
|
+
import { TwoFactorAuth } from "../components/two-factor-auth";
|
|
6
|
+
export { AdminButtons, AdminInviteButton, AlternativeMethods, CredentialsForm, LoginFormProvider, LogoutButton, TwoFactorAuth, useLoginForm };
|
|
7
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/exports/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdminButtons } from "../components/admin-buttons";
|
|
2
|
+
import { AdminInviteButton } from "../components/admin-invite-button";
|
|
3
|
+
import { AlternativeMethods, CredentialsForm, LoginFormProvider, useLoginForm } from "../components/login-form";
|
|
4
|
+
import { LogoutButton } from "../components/logout-button";
|
|
5
|
+
import { TwoFactorAuth } from "../components/two-factor-auth";
|
|
6
|
+
export { AdminButtons, AdminInviteButton, AlternativeMethods, CredentialsForm, LoginFormProvider, LogoutButton, TwoFactorAuth, useLoginForm };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC9leHBvcnRzL2NsaWVudC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBZG1pbkJ1dHRvbnMgfSBmcm9tIFwiLi4vY29tcG9uZW50cy9hZG1pbi1idXR0b25zXCI7XG5pbXBvcnQgeyBBZG1pbkludml0ZUJ1dHRvbiB9IGZyb20gXCIuLi9jb21wb25lbnRzL2FkbWluLWludml0ZS1idXR0b25cIjtcbmltcG9ydCB7XG4gIEFsdGVybmF0aXZlTWV0aG9kcyxcbiAgQ3JlZGVudGlhbHNGb3JtLFxuICBMb2dpbkZvcm1Qcm92aWRlcixcbiAgdXNlTG9naW5Gb3JtXG59IGZyb20gXCIuLi9jb21wb25lbnRzL2xvZ2luLWZvcm1cIjtcbmltcG9yd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components/passkeys";
|
|
2
|
+
import RSCRedirect from "../components/rsc-redirect";
|
|
3
|
+
import AdminLogin from "../views/admin-login";
|
|
4
|
+
import AdminSignup from "../views/admin-signup";
|
|
5
|
+
import ForgotPassword from "../views/forgot-password";
|
|
6
|
+
import ResetPassword from "../views/reset-password";
|
|
7
|
+
import TwoFactorVerify from "../views/two-factor-verify";
|
|
8
|
+
export { AdminLogin, AdminSignup, ForgotPassword, Passkeys, ResetPassword, RSCRedirect, TwoFactorVerify };
|
|
9
|
+
//# sourceMappingURL=rsc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/exports/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EACL,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,WAAW,EACX,eAAe,EAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Passkeys } from "../components/passkeys";
|
|
2
|
+
import RSCRedirect from "../components/rsc-redirect";
|
|
3
|
+
import AdminLogin from "../views/admin-login";
|
|
4
|
+
import AdminSignup from "../views/admin-signup";
|
|
5
|
+
import ForgotPassword from "../views/forgot-password";
|
|
6
|
+
import ResetPassword from "../views/reset-password";
|
|
7
|
+
import TwoFactorVerify from "../views/two-factor-verify";
|
|
8
|
+
export { AdminLogin, AdminSignup, ForgotPassword, Passkeys, ResetPassword, RSCRedirect, TwoFactorVerify };
|
|
9
|
+
|
|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BQVEsUUFBUSx5QkFBeUI7QUFDbEQsT0FBT0MsaUJBQWlCLDZCQUE2QjtBQUNyRCxPQUFPQyxnQkFBZ0IsdUJBQXVCO0FBQzlDLE9BQU9DLGlCQUFpQix3QkFBd0I7QUFDaEQsT0FBT0Msb0JBQW9CLDJCQUEyQjtBQUN0RCxPQUFPQyxtQkFBbUIsMEJBQTBCO0FBQ3BELE9BQU9DLHFCQUFxQiw2QkFBNkI7QUFFekQsU0FDRUosVUFBVSxFQUNWQyxXQUFXLEVBQ1hDLGNBQWMsRUFDZEosUUFBUSxFQUNSSyxhQUFhLEVBQ2JKLFdBQVcsRUFDWEssZUFBZSxHQUNmIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-admin-invite-url.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/utils/generate-admin-invite-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,eAAO,MAAM,sBAAsB,EAAE,wBAUpC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { adminRoutes } from "../../constants";
|
|
2
|
+
export const generateAdminInviteUrl = ({ payload, token })=>{
|
|
3
|
+
if (!payload?.config?.serverURL) {
|
|
4
|
+
payload.logger.warn("payload.config.serverURL is not set. Set it to generate a full URL for the admin invite link.");
|
|
5
|
+
}
|
|
6
|
+
return `${payload.getAdminURL()}${adminRoutes.adminSignup}?token=${token}`;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC91dGlscy9nZW5lcmF0ZS1hZG1pbi1pbnZpdGUtdXJsLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGFkbWluUm91dGVzIH0gZ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8sR0FBR0wsUUFBUU0sV0FBVyxLQUFLUixZQUFZUyxXQUFXLENBQUMsT0FBTyxFQUFFTixPQUFPO0FBQzVFLEVBQUUifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-safe-redirect.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/utils/get-safe-redirect.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,GAC1B,eAAe,MAAM,GAAG,MAAM,EAAE,EAChC,WAAU,MAAY,KACrB,MA8BF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const getSafeRedirect = (redirectParam, fallback = "/")=>{
|
|
2
|
+
if (typeof redirectParam !== "string") {
|
|
3
|
+
return fallback;
|
|
4
|
+
}
|
|
5
|
+
// Normalize and decode the path
|
|
6
|
+
let redirectPath;
|
|
7
|
+
try {
|
|
8
|
+
redirectPath = decodeURIComponent(redirectParam.trim());
|
|
9
|
+
} catch {
|
|
10
|
+
return fallback; // invalid encoding
|
|
11
|
+
}
|
|
12
|
+
const isSafeRedirect = // Must start with a single forward slash (e.g., "/admin")
|
|
13
|
+
redirectPath.startsWith("/") && // Prevent protocol-relative URLs (e.g., "//example.com")
|
|
14
|
+
!redirectPath.startsWith("//") && // Prevent encoded slashes that could resolve to protocol-relative
|
|
15
|
+
!redirectPath.startsWith("/%2F") && // Prevent backslash-based escape attempts (e.g., "/\\/example.com", "/\\\\example.com", "/\\example.com")
|
|
16
|
+
!redirectPath.startsWith("/\\/") && !redirectPath.startsWith("/\\\\") && !redirectPath.startsWith("/\\") && // Prevent javascript-based schemes (e.g., "/javascript:alert(1)")
|
|
17
|
+
!redirectPath.toLowerCase().startsWith("/javascript:") && // Prevent attempts to redirect to full URLs using "/http:" or "/https:"
|
|
18
|
+
!redirectPath.toLowerCase().startsWith("/http");
|
|
19
|
+
return isSafeRedirect ? redirectPath : fallback;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//# sourceMapping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l0aCIsInRvTG93ZXJDYXNlIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU1BLGtCQUFrQixDQUM3QkMsZUFDQUMsV0FBbUIsR0FBRztJQUV0QixJQUFJLE9BQU9ELGtCQUFrQixVQUFVO1FBQ3JDLE9BQU9DO0lBQ1Q7SUFFQSxnQ0FBZ0M7SUFDaEMsSUFBSUM7SUFDSixJQUFJO1FBQ0ZBLGVBQWVDLG1CQUFtQkgsY0FBY0ksSUFBSTtJQUN0RCxFQUFFLE9BQU07UUFDTixPQUFPSCxVQUFVLG1CQUFtQjtJQUN0QztJQUVBLE1BQU1JLGlCQUNKLDBEQUEwRDtJQUMxREgsYUFBYUksVUFBVSxDQUFDLFFBQ3hCLHlEQUF5RDtJQUN6RCxDQUFDSixhQUFhSSxVQUFVLENBQUMsU0FDekIsa0VBQWtFO0lBQ2xFLENBQUNKLGFBQWFJLFVBQVUsQ0FBQyxXQUN6QiwwR0FBMEc7SUFDMUcsQ0FBQ0osYUFBYUksVUFBVSxDQUFDLFdBQ3pCLENBQUNKLGFBQWFJLFVBQVUsQ0FBQyxZQUN6QixDQUFDSixhQUFhSSxVQUFVLENBQUMsVUFDekIsa0VBQWtFO0lBQ2xFLENBQUNKLGFBQWFLLFdBQVcsR0FBR0QsVUFBVSxDQUFDLG1CQUN2Qyx3RUFBd0U7SUFDeEUsQ0FBQ0osYUFBYUssV0FBVyxHQUFHRCxVQUFVLENBQUM7SUFFekMsT0FBT0QsaUJBQWlCSCxlQUFlRDtBQUN6QyxFQUFFIn0=
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LoginMethod } from "@/better-auth/plugin/types";
|
|
2
|
+
interface AdminLoginClientProps {
|
|
3
|
+
loginMethods: LoginMethod[];
|
|
4
|
+
plugins?: {
|
|
5
|
+
username?: boolean;
|
|
6
|
+
passkey?: boolean;
|
|
7
|
+
magicLink?: boolean;
|
|
8
|
+
};
|
|
9
|
+
loginIdentifiers: ("email" | "username")[];
|
|
10
|
+
prefill?: {
|
|
11
|
+
email?: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
username?: string;
|
|
14
|
+
};
|
|
15
|
+
searchParams: {
|
|
16
|
+
[key: string]: string | string[] | undefined;
|
|
17
|
+
};
|
|
18
|
+
baseURL?: string;
|
|
19
|
+
basePath?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function AdminLoginClient({ loginMethods, searchParams, loginIdentifiers, baseURL, basePath, plugins, prefill }: AdminLoginClientProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/better-auth/plugin/payload/views/admin-login/client.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,UAAU,qBAAqB;IAC7B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,gBAAgB,EAAE,CAAC,OAAO,GAAG,UAAU,CAAC,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACR,EAAE,qBAAqB,+BAqBvB"}
|