@meith/web 0.16.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.md +165 -0
- package/app/(auth)/layout.tsx +6 -0
- package/app/(auth)/login/page.tsx +106 -0
- package/app/(auth)/login/verify/page.tsx +55 -0
- package/app/(auth)/register/page.tsx +83 -0
- package/app/(auth)/reset/confirm/page.tsx +45 -0
- package/app/(auth)/reset/page.tsx +22 -0
- package/app/(auth)/verify/page.tsx +44 -0
- package/app/(auth)/verify/resend/page.tsx +51 -0
- package/app/(board)/[slug]/feed.xml/route.ts +48 -0
- package/app/(board)/[slug]/new/page.tsx +112 -0
- package/app/(board)/[slug]/page.tsx +403 -0
- package/app/(board)/discover/[view]/page.tsx +115 -0
- package/app/(board)/discover/page.tsx +5 -0
- package/app/(board)/layout.tsx +22 -0
- package/app/(board)/member/[id]/page.tsx +187 -0
- package/app/(board)/member/[id]/reputation/page.tsx +195 -0
- package/app/(board)/member/by-name/[name]/page.tsx +32 -0
- package/app/(board)/messages/[id]/page.tsx +103 -0
- package/app/(board)/messages/compose/page.tsx +60 -0
- package/app/(board)/messages/layout.tsx +5 -0
- package/app/(board)/messages/page.tsx +179 -0
- package/app/(board)/modcp/forums/page.tsx +59 -0
- package/app/(board)/modcp/ip/page.tsx +158 -0
- package/app/(board)/modcp/layout.tsx +5 -0
- package/app/(board)/modcp/log/page.tsx +98 -0
- package/app/(board)/modcp/page.tsx +112 -0
- package/app/(board)/moderation/layout.tsx +5 -0
- package/app/(board)/moderation/page.tsx +111 -0
- package/app/(board)/moderation/reports/page.tsx +193 -0
- package/app/(board)/moderation/warn/page.tsx +158 -0
- package/app/(board)/notifications/layout.tsx +5 -0
- package/app/(board)/notifications/page.tsx +144 -0
- package/app/(board)/notifications/preferences/page.tsx +65 -0
- package/app/(board)/online/page.tsx +119 -0
- package/app/(board)/page.tsx +195 -0
- package/app/(board)/plugins/[key]/[[...path]]/page.tsx +72 -0
- package/app/(board)/privacy/page.tsx +12 -0
- package/app/(board)/report/page.tsx +71 -0
- package/app/(board)/rules/page.tsx +12 -0
- package/app/(board)/search/[token]/page.tsx +130 -0
- package/app/(board)/search/page.tsx +289 -0
- package/app/(board)/stats/page.tsx +202 -0
- package/app/(board)/subscriptions/layout.tsx +5 -0
- package/app/(board)/subscriptions/page.tsx +142 -0
- package/app/(board)/terms/page.tsx +12 -0
- package/app/(board)/thread/[slug]/edit/page.tsx +107 -0
- package/app/(board)/thread/[slug]/feed.xml/route.ts +42 -0
- package/app/(board)/thread/[slug]/page.tsx +707 -0
- package/app/(board)/thread/[slug]/poll/page.tsx +41 -0
- package/app/(board)/thread/[slug]/post/[postId]/history/page.tsx +160 -0
- package/app/(board)/thread/[slug]/reply/page.tsx +136 -0
- package/app/(board)/unsubscribe/page.tsx +73 -0
- package/app/(board)/usercp/avatar/page.tsx +56 -0
- package/app/(board)/usercp/contacts/page.tsx +141 -0
- package/app/(board)/usercp/email/confirm/page.tsx +52 -0
- package/app/(board)/usercp/layout.tsx +23 -0
- package/app/(board)/usercp/options/page.tsx +56 -0
- package/app/(board)/usercp/page.tsx +71 -0
- package/app/(board)/usercp/profile/page.tsx +81 -0
- package/app/(board)/usercp/security/page.tsx +238 -0
- package/app/(board)/usercp/security/verify/page.tsx +92 -0
- package/app/(board)/usercp/signature/page.tsx +67 -0
- package/app/admin/antispam/page.tsx +155 -0
- package/app/admin/api/marketplace/screenshot/route.ts +68 -0
- package/app/admin/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/admin/api-tokens/page.tsx +129 -0
- package/app/admin/content/announcements/page.tsx +110 -0
- package/app/admin/content/attachments/page.tsx +199 -0
- package/app/admin/content/navigation/page.tsx +123 -0
- package/app/admin/content/page.tsx +170 -0
- package/app/admin/forums/[id]/page.tsx +96 -0
- package/app/admin/forums/[id]/permissions/page.tsx +108 -0
- package/app/admin/forums/page.tsx +45 -0
- package/app/admin/groups/[id]/page.tsx +133 -0
- package/app/admin/groups/memberships/page.tsx +56 -0
- package/app/admin/groups/page.tsx +104 -0
- package/app/admin/groups/promotions/page.tsx +143 -0
- package/app/admin/layout.tsx +86 -0
- package/app/admin/log/page.tsx +116 -0
- package/app/admin/page.tsx +206 -0
- package/app/admin/plugins/[key]/[[...path]]/page.tsx +276 -0
- package/app/admin/plugins/browse/page.tsx +70 -0
- package/app/admin/plugins/page.tsx +165 -0
- package/app/admin/security/page.tsx +124 -0
- package/app/admin/settings/page.tsx +190 -0
- package/app/admin/system/page.tsx +303 -0
- package/app/admin/themes/[key]/page.tsx +110 -0
- package/app/admin/themes/browse/page.tsx +70 -0
- package/app/admin/themes/page.tsx +163 -0
- package/app/admin/users/[id]/merge/page.tsx +136 -0
- package/app/admin/users/[id]/page.tsx +208 -0
- package/app/admin/users/mail/page.tsx +68 -0
- package/app/admin/users/page.tsx +260 -0
- package/app/admin/users/prune/page.tsx +186 -0
- package/app/api/health/route.ts +11 -0
- package/app/api/metrics/route.ts +66 -0
- package/app/api/plugins/[key]/[...path]/route.ts +27 -0
- package/app/api/read/all/route.ts +15 -0
- package/app/api/read/forum/[id]/route.ts +29 -0
- package/app/api/read/thread/[id]/route.ts +40 -0
- package/app/api/ready/route.ts +63 -0
- package/app/api/system/tick/route.ts +77 -0
- package/app/api/v1/[...path]/route.ts +208 -0
- package/app/api/v1/openapi.json/route.ts +12 -0
- package/app/apple-icon.ts +11 -0
- package/app/atom.xml/route.ts +7 -0
- package/app/attachment/[id]/route.ts +10 -0
- package/app/attachment/[id]/thumb/route.ts +10 -0
- package/app/auth/passkey/options/route.ts +145 -0
- package/app/auth/passkey/verify/route.ts +241 -0
- package/app/auth/resume/route.ts +55 -0
- package/app/auth/sso/[provider]/callback/route.ts +173 -0
- package/app/auth/sso/[provider]/go/route.ts +57 -0
- package/app/auth/sso/[provider]/route.ts +105 -0
- package/app/avatar/[id]/route.ts +31 -0
- package/app/brand/icon-192.png/route.ts +7 -0
- package/app/brand/icon-512.png/route.ts +7 -0
- package/app/brand/icon-maskable.png/route.ts +7 -0
- package/app/demo/stripe/[[...path]]/route.ts +27 -0
- package/app/error.tsx +15 -0
- package/app/feed.xml/route.ts +7 -0
- package/app/forumdisplay.php/page.tsx +11 -0
- package/app/group/[id]/badge/[scheme]/route.ts +26 -0
- package/app/icon.ts +13 -0
- package/app/install/page.tsx +221 -0
- package/app/jump/page.tsx +28 -0
- package/app/layout.tsx +124 -0
- package/app/logo/[scheme]/route.ts +24 -0
- package/app/manifest.ts +43 -0
- package/app/member.php/page.tsx +11 -0
- package/app/memberlist.php/page.tsx +11 -0
- package/app/not-found.tsx +14 -0
- package/app/opengraph-image.ts +11 -0
- package/app/redirect/page.tsx +44 -0
- package/app/robots.txt/route.ts +35 -0
- package/app/showthread.php/page.tsx +11 -0
- package/app/sitemap/[page]/route.ts +64 -0
- package/app/sitemap.xml/route.ts +31 -0
- package/app/twitter-image.ts +11 -0
- package/app/viewforum.php/page.tsx +11 -0
- package/app/viewtopic.php/page.tsx +11 -0
- package/bin/forum-web.mjs +241 -0
- package/components.json +21 -0
- package/instrumentation.ts +18 -0
- package/next.config.mjs +182 -0
- package/package.json +99 -0
- package/postcss.config.mjs +7 -0
- package/proxy.ts +160 -0
- package/src/components/account/active-sessions.tsx +87 -0
- package/src/components/account/avatar-form.tsx +119 -0
- package/src/components/account/credential-proof-form.tsx +76 -0
- package/src/components/account/logout-form.tsx +14 -0
- package/src/components/account/notification-forms.tsx +157 -0
- package/src/components/account/passkey-enrol.tsx +81 -0
- package/src/components/account/passkey-proof-button.tsx +47 -0
- package/src/components/account/push-device-form.tsx +193 -0
- package/src/components/account/relation-forms.tsx +69 -0
- package/src/components/account/reputation-forms.tsx +124 -0
- package/src/components/account/security-activity.tsx +46 -0
- package/src/components/account/sign-in-methods.tsx +166 -0
- package/src/components/account/subscription-forms.tsx +151 -0
- package/src/components/account/two-factor-forms.tsx +226 -0
- package/src/components/account/usercp-forms.tsx +387 -0
- package/src/components/account/usercp-nav.tsx +14 -0
- package/src/components/account/usercp-shell.tsx +34 -0
- package/src/components/admin/admin-forms.tsx +92 -0
- package/src/components/admin/admin-nav.tsx +52 -0
- package/src/components/admin/admin-undo.tsx +32 -0
- package/src/components/admin/api-token-forms.tsx +89 -0
- package/src/components/admin/badge-forms.tsx +97 -0
- package/src/components/admin/branding-forms.tsx +102 -0
- package/src/components/admin/content-forms.tsx +712 -0
- package/src/components/admin/form-bits.tsx +11 -0
- package/src/components/admin/forum-forms.tsx +524 -0
- package/src/components/admin/forum-tree.tsx +454 -0
- package/src/components/admin/group-forms.tsx +646 -0
- package/src/components/admin/mail-test-card.tsx +90 -0
- package/src/components/admin/marketplace-forms.tsx +30 -0
- package/src/components/admin/marketplace-listing.tsx +123 -0
- package/src/components/admin/navigation-forms.tsx +229 -0
- package/src/components/admin/navigation-tree.tsx +442 -0
- package/src/components/admin/oklch-picker.tsx +180 -0
- package/src/components/admin/plugin-forms.tsx +225 -0
- package/src/components/admin/settings-form.tsx +148 -0
- package/src/components/admin/system-forms.tsx +169 -0
- package/src/components/admin/theme-changes.tsx +354 -0
- package/src/components/admin/theme-forms.tsx +636 -0
- package/src/components/admin/theme-palette.tsx +119 -0
- package/src/components/admin/theme-preview.tsx +461 -0
- package/src/components/admin/user-bulk-toolbar.tsx +99 -0
- package/src/components/admin/user-forms.tsx +488 -0
- package/src/components/auth/auth-page.tsx +45 -0
- package/src/components/auth/form-controls.tsx +117 -0
- package/src/components/auth/login-form.tsx +47 -0
- package/src/components/auth/passkey-client.ts +171 -0
- package/src/components/auth/passkey-second-factor.tsx +69 -0
- package/src/components/auth/passkey-sign-in.tsx +61 -0
- package/src/components/auth/register-form.tsx +136 -0
- package/src/components/auth/resend-verification-form.tsx +34 -0
- package/src/components/auth/reset-confirm-form.tsx +43 -0
- package/src/components/auth/reset-request-form.tsx +35 -0
- package/src/components/auth/second-factor-form.tsx +51 -0
- package/src/components/auth/sso-buttons.tsx +47 -0
- package/src/components/board/live-region.tsx +74 -0
- package/src/components/board/search-off-notice.tsx +18 -0
- package/src/components/board/section-page.tsx +114 -0
- package/src/components/content/attachment-field.tsx +51 -0
- package/src/components/content/composer-field.ts +31 -0
- package/src/components/content/composer-ids.ts +6 -0
- package/src/components/content/composer-intents.tsx +27 -0
- package/src/components/content/composer-recovery.tsx +215 -0
- package/src/components/content/edit-post-form.tsx +121 -0
- package/src/components/content/markdown-editor.tsx +590 -0
- package/src/components/content/markdown-syntax.ts +53 -0
- package/src/components/content/mention-token.ts +23 -0
- package/src/components/content/multiquote-button.tsx +32 -0
- package/src/components/content/multiquote-selection.tsx +105 -0
- package/src/components/content/multiquote.ts +125 -0
- package/src/components/content/new-thread-form.tsx +169 -0
- package/src/components/content/poll-edit-form.tsx +96 -0
- package/src/components/content/poll.tsx +89 -0
- package/src/components/content/quote-in-place.tsx +51 -0
- package/src/components/content/reply-form.tsx +113 -0
- package/src/components/content/thanks-button.tsx +65 -0
- package/src/components/content/thread-rating.tsx +143 -0
- package/src/components/install/install-form.tsx +497 -0
- package/src/components/legal/legal-document.tsx +22 -0
- package/src/components/messages/message-forms.tsx +152 -0
- package/src/components/moderation/inline-moderation-form.tsx +158 -0
- package/src/components/moderation/modcp-nav.tsx +15 -0
- package/src/components/moderation/modcp-shell.tsx +41 -0
- package/src/components/moderation/queue-form.tsx +96 -0
- package/src/components/moderation/report-forms.tsx +120 -0
- package/src/components/moderation/signature-lock-form.tsx +83 -0
- package/src/components/moderation/thread-surgery-form.tsx +96 -0
- package/src/components/moderation/thread-tools-form.tsx +137 -0
- package/src/components/moderation/warning-forms.tsx +125 -0
- package/src/components/profile/custom-field.tsx +79 -0
- package/src/components/shell/appearance-icons.tsx +35 -0
- package/src/components/shell/board-notice.tsx +21 -0
- package/src/components/shell/copy-record.ts +20 -0
- package/src/components/shell/copy.tsx +17 -0
- package/src/components/shell/crash-notice.tsx +86 -0
- package/src/components/shell/demo-banner.tsx +49 -0
- package/src/components/shell/group-name-style.tsx +6 -0
- package/src/components/shell/measure.ts +1 -0
- package/src/components/shell/notification-menu.tsx +361 -0
- package/src/components/shell/offline-notice.tsx +29 -0
- package/src/components/shell/onboarding-banner.tsx +39 -0
- package/src/components/shell/page-shell.tsx +167 -0
- package/src/components/shell/panel-list.tsx +95 -0
- package/src/components/shell/panel-nav.tsx +40 -0
- package/src/components/shell/panel-overview.tsx +81 -0
- package/src/components/shell/panel-page.tsx +96 -0
- package/src/components/shell/panel-pagination.tsx +28 -0
- package/src/components/shell/panel-shell.tsx +31 -0
- package/src/components/shell/theme-runtime-style.tsx +6 -0
- package/src/components/shell/theme-switcher.tsx +97 -0
- package/src/components/shell/timezone-probe.tsx +45 -0
- package/src/components/shell/view-tabs.tsx +60 -0
- package/src/config.ts +13 -0
- package/src/server/absent-services.ts +29 -0
- package/src/server/admin-actions.ts +171 -0
- package/src/server/admin-settings-actions.ts +83 -0
- package/src/server/admin-undo-actions.ts +70 -0
- package/src/server/admin-undo.ts +75 -0
- package/src/server/admin.ts +112 -0
- package/src/server/announcements.ts +82 -0
- package/src/server/antispam.ts +310 -0
- package/src/server/api/content.ts +486 -0
- package/src/server/api/http.ts +119 -0
- package/src/server/api/members.ts +109 -0
- package/src/server/api/messages.ts +113 -0
- package/src/server/api/registry.ts +30 -0
- package/src/server/api/search.ts +98 -0
- package/src/server/api/subscriptions.ts +106 -0
- package/src/server/api-auth.ts +66 -0
- package/src/server/api-token-actions.ts +85 -0
- package/src/server/api-tokens-admin.ts +95 -0
- package/src/server/appearance-actions.ts +39 -0
- package/src/server/attachment-download.ts +43 -0
- package/src/server/attachment-embed.ts +63 -0
- package/src/server/attachment-upload-actions.ts +92 -0
- package/src/server/attachments.ts +257 -0
- package/src/server/auth-actions.ts +479 -0
- package/src/server/auth-config.ts +61 -0
- package/src/server/auth-events.ts +92 -0
- package/src/server/auth-form-state.ts +14 -0
- package/src/server/auth-mail.ts +104 -0
- package/src/server/avatars.ts +83 -0
- package/src/server/board-latest-actions.ts +7 -0
- package/src/server/board-latest.tsx +103 -0
- package/src/server/board-offline.ts +23 -0
- package/src/server/board-url.ts +14 -0
- package/src/server/brand-assets.ts +151 -0
- package/src/server/brand-mark.tsx +110 -0
- package/src/server/branding-actions.ts +53 -0
- package/src/server/branding.ts +101 -0
- package/src/server/cache-targets.ts +13 -0
- package/src/server/code-highlighting.ts +33 -0
- package/src/server/container.ts +402 -0
- package/src/server/content-actions.ts +459 -0
- package/src/server/content-admin-actions.ts +492 -0
- package/src/server/content-admin.ts +95 -0
- package/src/server/content-security-policy.ts +35 -0
- package/src/server/context.ts +32 -0
- package/src/server/cookies.ts +139 -0
- package/src/server/credential-proof-actions.ts +42 -0
- package/src/server/credential-proof.ts +35 -0
- package/src/server/current-location.ts +19 -0
- package/src/server/demo-stripe.ts +104 -0
- package/src/server/demo-uploads.ts +28 -0
- package/src/server/demo.ts +80 -0
- package/src/server/discovery.ts +104 -0
- package/src/server/embeds.ts +113 -0
- package/src/server/error-notice.tsx +41 -0
- package/src/server/federation-actions.ts +113 -0
- package/src/server/federation.ts +138 -0
- package/src/server/feed-builder.ts +72 -0
- package/src/server/feed-routes.ts +122 -0
- package/src/server/fixture-actor-source.ts +62 -0
- package/src/server/fixture-forum-repo.ts +59 -0
- package/src/server/fixture-member-profile-repo.ts +30 -0
- package/src/server/fixture-post-repo.ts +108 -0
- package/src/server/fixture-thread-repo.ts +98 -0
- package/src/server/form-state-reporter.ts +34 -0
- package/src/server/form-values.ts +23 -0
- package/src/server/forum-admin-actions.ts +353 -0
- package/src/server/forum-admin.ts +98 -0
- package/src/server/group-admin-actions.ts +341 -0
- package/src/server/group-admin.ts +98 -0
- package/src/server/group-badge-actions.ts +61 -0
- package/src/server/group-badge.ts +62 -0
- package/src/server/group-identity.ts +104 -0
- package/src/server/i18n-catalogs.ts +42 -0
- package/src/server/i18n.ts +69 -0
- package/src/server/image-upload.ts +109 -0
- package/src/server/inline-moderation-actions.ts +129 -0
- package/src/server/install-actions.ts +124 -0
- package/src/server/install.ts +281 -0
- package/src/server/legacy-redirect.ts +83 -0
- package/src/server/legal.ts +43 -0
- package/src/server/location-header.ts +37 -0
- package/src/server/mail-brand.ts +43 -0
- package/src/server/mail-health.ts +41 -0
- package/src/server/mail-send.ts +44 -0
- package/src/server/mail-test-actions.ts +67 -0
- package/src/server/mail-test.ts +56 -0
- package/src/server/markdown-pipeline.ts +31 -0
- package/src/server/marketplace-actions.ts +47 -0
- package/src/server/marketplace-admin.ts +260 -0
- package/src/server/mention-actions.ts +21 -0
- package/src/server/mention-search.ts +35 -0
- package/src/server/message-actions.ts +110 -0
- package/src/server/messages.ts +141 -0
- package/src/server/modcp.ts +125 -0
- package/src/server/moderation-actions.ts +165 -0
- package/src/server/navigation-admin-actions.ts +217 -0
- package/src/server/navigation.ts +112 -0
- package/src/server/nonce.ts +13 -0
- package/src/server/notification-actions.ts +84 -0
- package/src/server/notification-audience.ts +10 -0
- package/src/server/notification-menu-actions.ts +82 -0
- package/src/server/notification-menu.ts +96 -0
- package/src/server/notifications.ts +93 -0
- package/src/server/onboarding-actions.ts +27 -0
- package/src/server/onboarding.ts +89 -0
- package/src/server/page-metadata.ts +14 -0
- package/src/server/passkey-challenge.ts +42 -0
- package/src/server/plugin-admin-actions.ts +232 -0
- package/src/server/plugin-admin.ts +276 -0
- package/src/server/plugin-host.ts +143 -0
- package/src/server/plugin-pages.ts +192 -0
- package/src/server/plugin-panel.ts +49 -0
- package/src/server/plugin-routes.ts +298 -0
- package/src/server/plugin-view.tsx +58 -0
- package/src/server/poll-actions.ts +104 -0
- package/src/server/poll-scope.ts +52 -0
- package/src/server/post-notifications.ts +71 -0
- package/src/server/post-scope.ts +86 -0
- package/src/server/presence.ts +177 -0
- package/src/server/profile-fields.ts +112 -0
- package/src/server/push-actions.ts +113 -0
- package/src/server/push.ts +40 -0
- package/src/server/redirect-back.ts +15 -0
- package/src/server/registration.ts +7 -0
- package/src/server/relation-actions.ts +89 -0
- package/src/server/relations.ts +45 -0
- package/src/server/reply-core.ts +173 -0
- package/src/server/report-actions.ts +165 -0
- package/src/server/report-scope.ts +21 -0
- package/src/server/reputation-actions.ts +146 -0
- package/src/server/reputation-target.ts +49 -0
- package/src/server/reputation.ts +70 -0
- package/src/server/request-fingerprint.ts +65 -0
- package/src/server/safe-path.ts +16 -0
- package/src/server/same-origin.ts +45 -0
- package/src/server/search-page.ts +313 -0
- package/src/server/search.ts +45 -0
- package/src/server/secret-auth.ts +20 -0
- package/src/server/see-other.ts +11 -0
- package/src/server/seed-board.ts +417 -0
- package/src/server/session-actions.ts +78 -0
- package/src/server/session-cookies.ts +124 -0
- package/src/server/session-key.ts +17 -0
- package/src/server/settings.ts +47 -0
- package/src/server/signatures.ts +62 -0
- package/src/server/sso-handshake.ts +79 -0
- package/src/server/stats.ts +63 -0
- package/src/server/subscription-actions.ts +161 -0
- package/src/server/surgery-actions.ts +180 -0
- package/src/server/syndication.ts +77 -0
- package/src/server/system-admin-actions.ts +134 -0
- package/src/server/system-admin.ts +90 -0
- package/src/server/test-container.ts +114 -0
- package/src/server/theme-admin-actions.ts +242 -0
- package/src/server/theme-admin.ts +203 -0
- package/src/server/theme-runtime.ts +89 -0
- package/src/server/theme-style.ts +279 -0
- package/src/server/theme.ts +52 -0
- package/src/server/thread-core.ts +207 -0
- package/src/server/thread-rating-actions.ts +55 -0
- package/src/server/thread-tool-actions.ts +154 -0
- package/src/server/two-factor-actions.ts +178 -0
- package/src/server/two-factor.ts +86 -0
- package/src/server/upgrade-notice.ts +41 -0
- package/src/server/user-admin-actions.ts +572 -0
- package/src/server/user-admin.ts +165 -0
- package/src/server/usercp-actions.ts +263 -0
- package/src/server/usercp-mail.ts +120 -0
- package/src/server/viewer-preferences.ts +64 -0
- package/src/server/warning-actions.ts +122 -0
- package/src/styles/globals.css +969 -0
- package/src/theme/contract.fixture.ts +793 -0
- package/src/view/account-copy.ts +351 -0
- package/src/view/admin-content-copy.ts +66 -0
- package/src/view/admin-copy.ts +106 -0
- package/src/view/admin-forum-tree-copy.ts +40 -0
- package/src/view/admin-group-copy.ts +80 -0
- package/src/view/admin-log.ts +58 -0
- package/src/view/admin-nav.ts +164 -0
- package/src/view/admin-navigation-copy.ts +58 -0
- package/src/view/admin-panel-copy.ts +194 -0
- package/src/view/admin-settings.ts +173 -0
- package/src/view/admin-theme-copy.ts +229 -0
- package/src/view/admin-user-copy.ts +96 -0
- package/src/view/attachments.ts +51 -0
- package/src/view/auth-copy.ts +147 -0
- package/src/view/board-index.ts +167 -0
- package/src/view/board-latest.ts +101 -0
- package/src/view/breadcrumb.ts +50 -0
- package/src/view/contacts.ts +85 -0
- package/src/view/content-copy.ts +118 -0
- package/src/view/contrast.ts +286 -0
- package/src/view/copy.ts +101 -0
- package/src/view/count.ts +8 -0
- package/src/view/discovery-view.ts +74 -0
- package/src/view/editor-toolbar.ts +84 -0
- package/src/view/error-notice.ts +52 -0
- package/src/view/feed.ts +130 -0
- package/src/view/forum-cursor.ts +54 -0
- package/src/view/forum-display.ts +152 -0
- package/src/view/forum-jump.ts +60 -0
- package/src/view/forum-notice.ts +24 -0
- package/src/view/inline-moderation.ts +87 -0
- package/src/view/install-copy.ts +95 -0
- package/src/view/legal.ts +58 -0
- package/src/view/locale.ts +40 -0
- package/src/view/marketplace-panel.ts +51 -0
- package/src/view/member-identity.ts +23 -0
- package/src/view/member-profile.ts +65 -0
- package/src/view/messages.ts +222 -0
- package/src/view/metadata.ts +75 -0
- package/src/view/modcp-nav.ts +76 -0
- package/src/view/moderation-copy.ts +84 -0
- package/src/view/moderation-queue.ts +67 -0
- package/src/view/navigation-arrange.ts +188 -0
- package/src/view/navigation.ts +173 -0
- package/src/view/notification-menu.ts +202 -0
- package/src/view/notifications.ts +84 -0
- package/src/view/onboarding.ts +26 -0
- package/src/view/pager.ts +191 -0
- package/src/view/panel-nav.ts +203 -0
- package/src/view/plugin-panel.ts +42 -0
- package/src/view/post-form.ts +61 -0
- package/src/view/post-link.ts +29 -0
- package/src/view/presence.ts +99 -0
- package/src/view/promotion-rules.ts +52 -0
- package/src/view/redirect-notice.ts +21 -0
- package/src/view/reputation.ts +107 -0
- package/src/view/search-controls.ts +103 -0
- package/src/view/search-results.ts +291 -0
- package/src/view/security-activity.ts +73 -0
- package/src/view/setting-groups.ts +43 -0
- package/src/view/shell.ts +164 -0
- package/src/view/slug-id.ts +12 -0
- package/src/view/sso-hand-off.ts +44 -0
- package/src/view/sso-notices.ts +48 -0
- package/src/view/subscriptions.ts +76 -0
- package/src/view/theme-draft.ts +167 -0
- package/src/view/theme-preference.ts +30 -0
- package/src/view/theme-tokens.ts +333 -0
- package/src/view/thread-view.ts +280 -0
- package/src/view/time.ts +31 -0
- package/src/view/timezone.ts +35 -0
- package/src/view/two-factor.ts +6 -0
- package/src/view/usercp-nav.ts +103 -0
- package/src/view/usercp.ts +196 -0
- package/src/view/warnings.ts +128 -0
- package/src/view/word-filter.ts +5 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { OptionsForm } from '@/components/account/usercp-forms'
|
|
5
|
+
import { BoardNotice } from '@/components/shell/board-notice'
|
|
6
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
7
|
+
import { getContainer } from '@/server/container'
|
|
8
|
+
import { getActor } from '@/server/context'
|
|
9
|
+
import { catalogs, getTranslator, tr } from '@/server/i18n'
|
|
10
|
+
import { getSettings } from '@/server/settings'
|
|
11
|
+
import { optionsFormCopy } from '@/view/account-copy'
|
|
12
|
+
import { localeChoices, optionsFormValues, timezoneChoices, userCpNotice } from '@/view/usercp'
|
|
13
|
+
|
|
14
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
15
|
+
return { title: await tr('page.options') }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default async function OptionsPage({
|
|
19
|
+
searchParams,
|
|
20
|
+
}: {
|
|
21
|
+
searchParams: Promise<{ saved?: string }>
|
|
22
|
+
}) {
|
|
23
|
+
const query = await searchParams
|
|
24
|
+
const actor = await getActor()
|
|
25
|
+
const { memberSettings } = getContainer()
|
|
26
|
+
if (actor.userId === null || memberSettings === null) notFound()
|
|
27
|
+
|
|
28
|
+
const settings = await memberSettings.read(actor.userId)
|
|
29
|
+
if (settings === null) notFound()
|
|
30
|
+
|
|
31
|
+
const board = await getSettings()
|
|
32
|
+
const values = optionsFormValues(settings)
|
|
33
|
+
const notice = userCpNotice(query, await getTranslator())
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<PanelPage
|
|
37
|
+
title={await tr('page.options')}
|
|
38
|
+
lede={await tr('page.language-timezone-how-much-thread')}
|
|
39
|
+
>
|
|
40
|
+
{notice !== null && (
|
|
41
|
+
<BoardNotice kind={notice.kind} message={notice.message} dismissHref="/usercp/options" />
|
|
42
|
+
)}
|
|
43
|
+
|
|
44
|
+
<OptionsForm
|
|
45
|
+
{...values}
|
|
46
|
+
timezones={timezoneChoices(await getTranslator())}
|
|
47
|
+
locales={localeChoices(catalogs.locales, await getTranslator())}
|
|
48
|
+
copy={optionsFormCopy(
|
|
49
|
+
board.get('display.posts_per_page'),
|
|
50
|
+
board.get('display.threads_per_page'),
|
|
51
|
+
await getTranslator(),
|
|
52
|
+
)}
|
|
53
|
+
/>
|
|
54
|
+
</PanelPage>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { BoardNotice } from '@/components/shell/board-notice'
|
|
5
|
+
import { PanelSectionGrid, PanelWaitingList } from '@/components/shell/panel-overview'
|
|
6
|
+
import { PanelPage, PanelSection } from '@/components/shell/panel-page'
|
|
7
|
+
import { getContainer } from '@/server/container'
|
|
8
|
+
import { getActor } from '@/server/context'
|
|
9
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
10
|
+
import { unreadMessageCount } from '@/server/messages'
|
|
11
|
+
import { unreadNotificationCount } from '@/server/notifications'
|
|
12
|
+
import { panelSectionCopy } from '@/view/panel-nav'
|
|
13
|
+
import { USERCP_SECTIONS } from '@/view/usercp-nav'
|
|
14
|
+
|
|
15
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
16
|
+
return { title: await tr('page.control-panel-2') }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default async function UserCpPage() {
|
|
20
|
+
const actor = await getActor()
|
|
21
|
+
const { memberSettings } = getContainer()
|
|
22
|
+
if (actor.userId === null || memberSettings === null) notFound()
|
|
23
|
+
|
|
24
|
+
const translator = await getTranslator()
|
|
25
|
+
|
|
26
|
+
const [messages, notifications] = await Promise.all([
|
|
27
|
+
unreadMessageCount(actor.userId),
|
|
28
|
+
unreadNotificationCount(actor.userId),
|
|
29
|
+
])
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<PanelPage
|
|
33
|
+
title={await tr('page.control-panel-2')}
|
|
34
|
+
lede={await tr('page.everything-about-account-that-decide')}
|
|
35
|
+
gap="loose"
|
|
36
|
+
>
|
|
37
|
+
<BoardNotice
|
|
38
|
+
kind="info"
|
|
39
|
+
message={translator.t('board.usercp.profilePrivacy')}
|
|
40
|
+
dismissHref={null}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<PanelSection id="waiting-heading" title={await tr('page.waiting-for')}>
|
|
44
|
+
<PanelWaitingList
|
|
45
|
+
items={[
|
|
46
|
+
{
|
|
47
|
+
count: messages,
|
|
48
|
+
one: translator.t('board.usercp.unreadMessage', { count: 1 }),
|
|
49
|
+
many: translator.t('board.usercp.unreadMessage', { count: 2 }),
|
|
50
|
+
href: '/messages',
|
|
51
|
+
action: translator.t('board.usercp.read'),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
count: notifications,
|
|
55
|
+
one: translator.t('board.usercp.unreadNotification', { count: 1 }),
|
|
56
|
+
many: translator.t('board.usercp.unreadNotification', { count: 2 }),
|
|
57
|
+
href: '/notifications',
|
|
58
|
+
action: translator.t('board.usercp.open'),
|
|
59
|
+
},
|
|
60
|
+
]}
|
|
61
|
+
emptyTitle={translator.t('board.usercp.emptyTitle')}
|
|
62
|
+
emptyDescription={translator.t('board.usercp.emptyDescription')}
|
|
63
|
+
/>
|
|
64
|
+
</PanelSection>
|
|
65
|
+
|
|
66
|
+
<PanelSection id="sections-heading" title={await tr('page.sections')}>
|
|
67
|
+
<PanelSectionGrid sections={panelSectionCopy(USERCP_SECTIONS, translator)} />
|
|
68
|
+
</PanelSection>
|
|
69
|
+
</PanelPage>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { DisplayGroupForm, ProfileForm } from '@/components/account/usercp-forms'
|
|
5
|
+
import { BoardNotice } from '@/components/shell/board-notice'
|
|
6
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
7
|
+
import { getContainer } from '@/server/container'
|
|
8
|
+
import { getActor } from '@/server/context'
|
|
9
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
10
|
+
import { profileFieldService, viewerFieldContext } from '@/server/profile-fields'
|
|
11
|
+
import { displayGroupFormCopy, profileFormCopy } from '@/view/account-copy'
|
|
12
|
+
import {
|
|
13
|
+
customFieldInputs,
|
|
14
|
+
displayGroupChoices,
|
|
15
|
+
profileFormValues,
|
|
16
|
+
userCpNotice,
|
|
17
|
+
} from '@/view/usercp'
|
|
18
|
+
|
|
19
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
20
|
+
return { title: await tr('page.profile') }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default async function ProfileSettingsPage({
|
|
24
|
+
searchParams,
|
|
25
|
+
}: {
|
|
26
|
+
searchParams: Promise<{ saved?: string }>
|
|
27
|
+
}) {
|
|
28
|
+
const query = await searchParams
|
|
29
|
+
const actor = await getActor()
|
|
30
|
+
const { memberSettings } = getContainer()
|
|
31
|
+
if (actor.userId === null || memberSettings === null) notFound()
|
|
32
|
+
|
|
33
|
+
const settings = await memberSettings.read(actor.userId)
|
|
34
|
+
if (settings === null) notFound()
|
|
35
|
+
|
|
36
|
+
const values = profileFormValues(settings)
|
|
37
|
+
const groups = displayGroupChoices(
|
|
38
|
+
await memberSettings.groupsHeldBy(actor.userId),
|
|
39
|
+
settings.displayGroupId,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const fields = profileFieldService()
|
|
43
|
+
const context = await viewerFieldContext()
|
|
44
|
+
const customFields =
|
|
45
|
+
fields === null || context === null
|
|
46
|
+
? []
|
|
47
|
+
: customFieldInputs(await fields.editableFor(actor.userId, context))
|
|
48
|
+
const notice = userCpNotice(query, await getTranslator())
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<PanelPage
|
|
52
|
+
title={await tr('page.profile')}
|
|
53
|
+
lede={
|
|
54
|
+
<>
|
|
55
|
+
Shown on{' '}
|
|
56
|
+
<a
|
|
57
|
+
href={`/member/${settings.userId}`}
|
|
58
|
+
className="font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground"
|
|
59
|
+
>
|
|
60
|
+
your public profile
|
|
61
|
+
</a>
|
|
62
|
+
.
|
|
63
|
+
</>
|
|
64
|
+
}
|
|
65
|
+
>
|
|
66
|
+
{notice !== null && (
|
|
67
|
+
<BoardNotice kind={notice.kind} message={notice.message} dismissHref="/usercp/profile" />
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<ProfileForm
|
|
71
|
+
{...values}
|
|
72
|
+
customFields={customFields}
|
|
73
|
+
copy={profileFormCopy(await getTranslator())}
|
|
74
|
+
/>
|
|
75
|
+
|
|
76
|
+
{groups.choices.length > 1 && (
|
|
77
|
+
<DisplayGroupForm {...groups} copy={displayGroupFormCopy(await getTranslator())} />
|
|
78
|
+
)}
|
|
79
|
+
</PanelPage>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { PASSKEY_LIMIT, providerLabel } from '@meith/accounts'
|
|
5
|
+
|
|
6
|
+
import { ActiveSessions, type SessionView } from '@/components/account/active-sessions'
|
|
7
|
+
import { PasskeyEnrol } from '@/components/account/passkey-enrol'
|
|
8
|
+
import { type ActivityView, SecurityActivity } from '@/components/account/security-activity'
|
|
9
|
+
import {
|
|
10
|
+
type LinkedIdentityView,
|
|
11
|
+
LinkedSignIns,
|
|
12
|
+
type OfferedProvider,
|
|
13
|
+
PasskeyList,
|
|
14
|
+
type PasskeyView,
|
|
15
|
+
} from '@/components/account/sign-in-methods'
|
|
16
|
+
import { TwoFactorPanel, TwoFactorSetup } from '@/components/account/two-factor-forms'
|
|
17
|
+
import { EmailForm, PasswordForm } from '@/components/account/usercp-forms'
|
|
18
|
+
import { BoardNotice } from '@/components/shell/board-notice'
|
|
19
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
20
|
+
import { boardAuthConfig } from '@/server/auth-config'
|
|
21
|
+
import { memberSecurityActivity } from '@/server/auth-events'
|
|
22
|
+
import { getContainer } from '@/server/container'
|
|
23
|
+
import { getActor } from '@/server/context'
|
|
24
|
+
import { memberManagedSignIns, passkeysEnabled, signInProviders } from '@/server/federation'
|
|
25
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
26
|
+
import { currentSessionId } from '@/server/session-actions'
|
|
27
|
+
import { pendingEnrolment, secondFactorPosture, twoFactorState } from '@/server/two-factor'
|
|
28
|
+
import {
|
|
29
|
+
activeSessionsCopy,
|
|
30
|
+
activityDetailLabel,
|
|
31
|
+
emailFormCopy,
|
|
32
|
+
linkedUsageLabel,
|
|
33
|
+
passkeyUsageLabel,
|
|
34
|
+
passwordFormCopy,
|
|
35
|
+
securityActivityCopy,
|
|
36
|
+
sessionDetailLabel,
|
|
37
|
+
signInMethodsCopy,
|
|
38
|
+
twoFactorFormsCopy,
|
|
39
|
+
} from '@/view/account-copy'
|
|
40
|
+
import { passkeyEnrolCopy } from '@/view/auth-copy'
|
|
41
|
+
import { authEventLabel, describeAddress, describeDevice } from '@/view/security-activity'
|
|
42
|
+
import { ssoNotice } from '@/view/sso-notices'
|
|
43
|
+
import { formatDate, formatTime } from '@/view/time'
|
|
44
|
+
import { userCpNotice } from '@/view/usercp'
|
|
45
|
+
|
|
46
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
47
|
+
return { title: await tr('page.account-security') }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const NOTICE_KEYS: Record<string, string> = {
|
|
51
|
+
'passkey:added': 'securityNotice.passkeyAdded',
|
|
52
|
+
'passkey:removed': 'securityNotice.passkeyRemoved',
|
|
53
|
+
'factor:setup': 'securityNotice.factorSetup',
|
|
54
|
+
'factor:off': 'securityNotice.factorOff',
|
|
55
|
+
'sessions:revoked': 'securityNotice.sessionRevoked',
|
|
56
|
+
'sessions:elsewhere': 'securityNotice.sessionsElsewhere',
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface SecurityQuery {
|
|
60
|
+
changed?: string
|
|
61
|
+
sent?: string
|
|
62
|
+
confirmed?: string
|
|
63
|
+
failed?: string
|
|
64
|
+
sso?: string
|
|
65
|
+
passkey?: string
|
|
66
|
+
factor?: string
|
|
67
|
+
sessions?: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default async function SecurityPage({
|
|
71
|
+
searchParams,
|
|
72
|
+
}: {
|
|
73
|
+
searchParams: Promise<SecurityQuery>
|
|
74
|
+
}) {
|
|
75
|
+
const query = await searchParams
|
|
76
|
+
const actor = await getActor()
|
|
77
|
+
const { memberSettings, accountStore } = getContainer()
|
|
78
|
+
if (actor.userId === null || memberSettings === null) notFound()
|
|
79
|
+
|
|
80
|
+
const settings = await memberSettings.read(actor.userId)
|
|
81
|
+
if (settings === null) notFound()
|
|
82
|
+
|
|
83
|
+
const notice = await pageNotice(query)
|
|
84
|
+
|
|
85
|
+
const manageable = await memberManagedSignIns()
|
|
86
|
+
const providers = await signInProviders()
|
|
87
|
+
const passkeys = await passkeysEnabled()
|
|
88
|
+
|
|
89
|
+
const translator = await getTranslator()
|
|
90
|
+
const on = (at: Date | null): string | null =>
|
|
91
|
+
at === null ? null : formatDate(at, translator).label
|
|
92
|
+
|
|
93
|
+
const account = await accountStore.accounts.findById(actor.userId)
|
|
94
|
+
const hasPassword = account !== null && account.passwordHash !== null
|
|
95
|
+
|
|
96
|
+
const posture = await secondFactorPosture(actor.userId)
|
|
97
|
+
const factor = await twoFactorState(actor.userId)
|
|
98
|
+
const manageFactor = posture.offered || factor.enrolled
|
|
99
|
+
|
|
100
|
+
const enrolment = factor.pending ? await pendingEnrolment(actor.userId) : null
|
|
101
|
+
|
|
102
|
+
const settingUp = factor.pending || query.factor === 'setup'
|
|
103
|
+
|
|
104
|
+
const linked = await accountStore.identities.listForUser(actor.userId)
|
|
105
|
+
const labels = new Map<string, string>(providers.map((provider) => [provider.id, provider.label]))
|
|
106
|
+
|
|
107
|
+
const linkedView: readonly LinkedIdentityView[] = linked.map((identity) => ({
|
|
108
|
+
id: identity.id,
|
|
109
|
+
provider: identity.provider,
|
|
110
|
+
label: labels.get(identity.provider) ?? providerLabel(identity.provider),
|
|
111
|
+
detail: identity.label,
|
|
112
|
+
usage: linkedUsageLabel(on(identity.linkedAt) ?? '', on(identity.lastUsedAt), translator),
|
|
113
|
+
}))
|
|
114
|
+
|
|
115
|
+
const offered: readonly OfferedProvider[] = providers
|
|
116
|
+
.filter((provider) => !linked.some((identity) => identity.provider === provider.id))
|
|
117
|
+
.map((provider) => ({
|
|
118
|
+
id: provider.id,
|
|
119
|
+
cta: translator.t('accountForm.linked.link', { provider: provider.label }),
|
|
120
|
+
}))
|
|
121
|
+
|
|
122
|
+
const held = passkeys ? await accountStore.passkeys.listForUser(actor.userId) : []
|
|
123
|
+
const passkeyView: readonly PasskeyView[] = held.map((passkey) => ({
|
|
124
|
+
id: passkey.id,
|
|
125
|
+
label: passkey.label,
|
|
126
|
+
usage: passkeyUsageLabel(on(passkey.createdAt) ?? '', on(passkey.lastUsedAt), translator),
|
|
127
|
+
}))
|
|
128
|
+
|
|
129
|
+
const rightNow = new Date()
|
|
130
|
+
const when = (at: Date): string => formatTime(at, rightNow, translator).label
|
|
131
|
+
|
|
132
|
+
const thisSession = await currentSessionId()
|
|
133
|
+
const sessionView: readonly SessionView[] = (
|
|
134
|
+
await accountStore.sessions.listActiveForUser(actor.userId, rightNow)
|
|
135
|
+
).map((session) => ({
|
|
136
|
+
id: session.id,
|
|
137
|
+
device: describeDevice(session.userAgent, translator),
|
|
138
|
+
detail: sessionDetailLabel(
|
|
139
|
+
describeAddress(session.ipPrefix),
|
|
140
|
+
when(session.createdAt),
|
|
141
|
+
when(session.lastSeenAt),
|
|
142
|
+
translator,
|
|
143
|
+
),
|
|
144
|
+
current: session.id === thisSession,
|
|
145
|
+
}))
|
|
146
|
+
|
|
147
|
+
const activity: readonly ActivityView[] = (await memberSecurityActivity(actor.userId)).map(
|
|
148
|
+
(event) => ({
|
|
149
|
+
id: event.id,
|
|
150
|
+
label: authEventLabel(event.kind, translator),
|
|
151
|
+
detail: activityDetailLabel(
|
|
152
|
+
when(event.at),
|
|
153
|
+
describeDevice(event.userAgent, translator),
|
|
154
|
+
describeAddress(event.ipPrefix),
|
|
155
|
+
translator,
|
|
156
|
+
),
|
|
157
|
+
}),
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
const anywhereToSignIn = providers.length > 0 || linked.length > 0
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<PanelPage
|
|
164
|
+
title={await tr('page.account-security')}
|
|
165
|
+
lede={await tr('page.changing-either-e-mail-address-password')}
|
|
166
|
+
>
|
|
167
|
+
{notice !== null && (
|
|
168
|
+
<BoardNotice kind={notice.kind} message={notice.message} dismissHref="/usercp/security" />
|
|
169
|
+
)}
|
|
170
|
+
|
|
171
|
+
<PasswordForm
|
|
172
|
+
minLength={(await boardAuthConfig()).minPasswordLength}
|
|
173
|
+
copy={passwordFormCopy(translator)}
|
|
174
|
+
/>
|
|
175
|
+
<EmailForm email={settings.email} copy={emailFormCopy(translator)} />
|
|
176
|
+
|
|
177
|
+
{manageFactor &&
|
|
178
|
+
(settingUp ? (
|
|
179
|
+
<TwoFactorSetup
|
|
180
|
+
enrolment={enrolment}
|
|
181
|
+
copy={twoFactorFormsCopy(factor.recoveryCodesLeft, translator)}
|
|
182
|
+
/>
|
|
183
|
+
) : (
|
|
184
|
+
<TwoFactorPanel
|
|
185
|
+
enrolled={factor.enrolled}
|
|
186
|
+
required={posture.required}
|
|
187
|
+
hasPassword={hasPassword}
|
|
188
|
+
recoveryCodesLeft={factor.recoveryCodesLeft}
|
|
189
|
+
copy={twoFactorFormsCopy(factor.recoveryCodesLeft, translator)}
|
|
190
|
+
/>
|
|
191
|
+
))}
|
|
192
|
+
|
|
193
|
+
{anywhereToSignIn && (
|
|
194
|
+
<LinkedSignIns
|
|
195
|
+
linked={linkedView}
|
|
196
|
+
offered={offered}
|
|
197
|
+
manageable={manageable}
|
|
198
|
+
copy={signInMethodsCopy(translator)}
|
|
199
|
+
/>
|
|
200
|
+
)}
|
|
201
|
+
|
|
202
|
+
{passkeys && (
|
|
203
|
+
<PasskeyList
|
|
204
|
+
passkeys={passkeyView}
|
|
205
|
+
manageable={manageable}
|
|
206
|
+
copy={signInMethodsCopy(translator)}
|
|
207
|
+
>
|
|
208
|
+
<PasskeyEnrol copy={passkeyEnrolCopy(PASSKEY_LIMIT, await getTranslator())} />
|
|
209
|
+
</PasskeyList>
|
|
210
|
+
)}
|
|
211
|
+
|
|
212
|
+
<ActiveSessions sessions={sessionView} copy={activeSessionsCopy(translator)} />
|
|
213
|
+
|
|
214
|
+
<SecurityActivity events={activity} copy={securityActivityCopy(translator)} />
|
|
215
|
+
</PanelPage>
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async function pageNotice(
|
|
220
|
+
query: SecurityQuery,
|
|
221
|
+
): Promise<{ kind: 'info' | 'warning'; message: string } | null> {
|
|
222
|
+
const federated = ssoNotice(query.sso, await getTranslator())
|
|
223
|
+
if (federated !== null) return federated
|
|
224
|
+
|
|
225
|
+
for (const [key, value] of [
|
|
226
|
+
['passkey', query.passkey],
|
|
227
|
+
['factor', query.factor],
|
|
228
|
+
['sessions', query.sessions],
|
|
229
|
+
] as const) {
|
|
230
|
+
if (value === undefined) continue
|
|
231
|
+
|
|
232
|
+
const messageKey = NOTICE_KEYS[`${key}:${value}`]
|
|
233
|
+
if (messageKey !== undefined)
|
|
234
|
+
return { kind: 'info', message: (await getTranslator()).t(messageKey) }
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return userCpNotice(query, await getTranslator())
|
|
238
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { CredentialProofForm } from '@/components/account/credential-proof-form'
|
|
5
|
+
import { PasskeyProofButton } from '@/components/account/passkey-proof-button'
|
|
6
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
7
|
+
import { getContainer } from '@/server/container'
|
|
8
|
+
import { getActor } from '@/server/context'
|
|
9
|
+
import { signInProviders } from '@/server/federation'
|
|
10
|
+
import { getTranslator } from '@/server/i18n'
|
|
11
|
+
import { isSafeLocalPath } from '@/server/safe-path'
|
|
12
|
+
import { twoFactorState } from '@/server/two-factor'
|
|
13
|
+
import { passkeyEnrolCopy } from '@/view/auth-copy'
|
|
14
|
+
|
|
15
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
16
|
+
const tr = await getTranslator()
|
|
17
|
+
return { title: tr.t('credentialProof.title') }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default async function VerifySecurityPage({
|
|
21
|
+
searchParams,
|
|
22
|
+
}: {
|
|
23
|
+
searchParams: Promise<{ next?: string }>
|
|
24
|
+
}) {
|
|
25
|
+
const actor = await getActor()
|
|
26
|
+
if (actor.userId === null) notFound()
|
|
27
|
+
|
|
28
|
+
const query = await searchParams
|
|
29
|
+
const next =
|
|
30
|
+
query.next !== undefined && isSafeLocalPath(query.next) ? query.next : '/usercp/security'
|
|
31
|
+
const tr = await getTranslator()
|
|
32
|
+
const { accountStore } = getContainer()
|
|
33
|
+
const [account, factor, identities, providers, passkeys] = await Promise.all([
|
|
34
|
+
accountStore.accounts.findById(actor.userId),
|
|
35
|
+
twoFactorState(actor.userId),
|
|
36
|
+
accountStore.identities.listForUser(actor.userId),
|
|
37
|
+
signInProviders(),
|
|
38
|
+
accountStore.passkeys.listForUser(actor.userId),
|
|
39
|
+
])
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<PanelPage title={tr.t('credentialProof.title')} lede={tr.t('credentialProof.lede')}>
|
|
43
|
+
<CredentialProofForm
|
|
44
|
+
copy={{
|
|
45
|
+
codeConsumed: tr.t('credentialProof.codeConsumed'),
|
|
46
|
+
codeLabel: tr.t('credentialProof.codeLabel'),
|
|
47
|
+
codeSubmit: tr.t('credentialProof.codeSubmit'),
|
|
48
|
+
passwordLabel: tr.t('credentialProof.passwordLabel'),
|
|
49
|
+
passwordSubmit: tr.t('credentialProof.passwordSubmit'),
|
|
50
|
+
}}
|
|
51
|
+
hasPassword={account?.passwordHash !== null && account !== null}
|
|
52
|
+
hasSecondFactor={factor.enrolled}
|
|
53
|
+
next={next}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{passkeys.length > 0 ? (
|
|
57
|
+
<PasskeyProofButton
|
|
58
|
+
next={next}
|
|
59
|
+
copy={passkeyEnrolCopy(1, tr)}
|
|
60
|
+
waitingLabel={tr.t('credentialProof.passkeyWaiting')}
|
|
61
|
+
verifyLabel={tr.t('credentialProof.passkeySubmit')}
|
|
62
|
+
/>
|
|
63
|
+
) : null}
|
|
64
|
+
|
|
65
|
+
{identities.length > 0 ? (
|
|
66
|
+
<section className="flex flex-col gap-3 rounded-lg border border-border bg-card p-5">
|
|
67
|
+
<h2 className="text-lg font-semibold tracking-tight">
|
|
68
|
+
{tr.t('credentialProof.linkedTitle')}
|
|
69
|
+
</h2>
|
|
70
|
+
<div className="flex flex-wrap gap-2">
|
|
71
|
+
{identities.map((identity) => {
|
|
72
|
+
const provider = providers.find((candidate) => candidate.id === identity.provider)
|
|
73
|
+
if (provider === undefined) return null
|
|
74
|
+
return (
|
|
75
|
+
<form key={identity.id} method="post" action={`/auth/sso/${identity.provider}`}>
|
|
76
|
+
<input type="hidden" name="mode" value="credential-proof" />
|
|
77
|
+
<input type="hidden" name="next" value={next} />
|
|
78
|
+
<button
|
|
79
|
+
type="submit"
|
|
80
|
+
className="inline-flex h-9 items-center rounded-md border border-border bg-card px-3 text-sm font-medium hover:bg-muted"
|
|
81
|
+
>
|
|
82
|
+
{tr.t('credentialProof.ssoSubmit', { provider: provider.label })}
|
|
83
|
+
</button>
|
|
84
|
+
</form>
|
|
85
|
+
)
|
|
86
|
+
})}
|
|
87
|
+
</div>
|
|
88
|
+
</section>
|
|
89
|
+
) : null}
|
|
90
|
+
</PanelPage>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { notFound } from 'next/navigation'
|
|
3
|
+
|
|
4
|
+
import { signatureLimit } from '@meith/signatures'
|
|
5
|
+
|
|
6
|
+
import { SignatureForm } from '@/components/account/usercp-forms'
|
|
7
|
+
import { BoardNotice } from '@/components/shell/board-notice'
|
|
8
|
+
import { PanelPage } from '@/components/shell/panel-page'
|
|
9
|
+
import { getActor } from '@/server/context'
|
|
10
|
+
import { getTranslator, tr } from '@/server/i18n'
|
|
11
|
+
import { renderSignature, signatureStore, viewerSignatureLimits } from '@/server/signatures'
|
|
12
|
+
import { signatureFormCopy } from '@/view/account-copy'
|
|
13
|
+
import { userCpNotice } from '@/view/usercp'
|
|
14
|
+
|
|
15
|
+
export async function generateMetadata(): Promise<Metadata> {
|
|
16
|
+
return { title: await tr('page.signature') }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default async function SignaturePage({
|
|
20
|
+
searchParams,
|
|
21
|
+
}: {
|
|
22
|
+
searchParams: Promise<{ saved?: string }>
|
|
23
|
+
}) {
|
|
24
|
+
const query = await searchParams
|
|
25
|
+
const actor = await getActor()
|
|
26
|
+
const store = signatureStore()
|
|
27
|
+
|
|
28
|
+
if (actor.userId === null || store === null) notFound()
|
|
29
|
+
|
|
30
|
+
const limits = await viewerSignatureLimits()
|
|
31
|
+
if (!limits.canUse) notFound()
|
|
32
|
+
|
|
33
|
+
const stored = await store.read(actor.userId)
|
|
34
|
+
if (stored === null) notFound()
|
|
35
|
+
|
|
36
|
+
const notice = userCpNotice(query, await getTranslator())
|
|
37
|
+
const preview = await renderSignature(actor.userId, stored)
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<PanelPage
|
|
41
|
+
title={await tr('page.signature')}
|
|
42
|
+
lede={await tr('page.shown-under-every-post-have')}
|
|
43
|
+
>
|
|
44
|
+
{notice !== null && (
|
|
45
|
+
<BoardNotice kind={notice.kind} message={notice.message} dismissHref="/usercp/signature" />
|
|
46
|
+
)}
|
|
47
|
+
|
|
48
|
+
<SignatureForm
|
|
49
|
+
signature={stored.signature}
|
|
50
|
+
maxLength={signatureLimit(limits)}
|
|
51
|
+
locked={stored.locked}
|
|
52
|
+
lockedReason={stored.lockedReason}
|
|
53
|
+
copy={signatureFormCopy(signatureLimit(limits), await getTranslator())}
|
|
54
|
+
/>
|
|
55
|
+
|
|
56
|
+
{preview !== null && (
|
|
57
|
+
<section className="flex flex-col gap-2">
|
|
58
|
+
<h2 className="text-sm font-medium">{await tr('page.how-it-looks')}</h2>
|
|
59
|
+
<div
|
|
60
|
+
className="rounded-lg border border-border bg-card p-4 text-sm"
|
|
61
|
+
dangerouslySetInnerHTML={{ __html: preview }}
|
|
62
|
+
/>
|
|
63
|
+
</section>
|
|
64
|
+
)}
|
|
65
|
+
</PanelPage>
|
|
66
|
+
)
|
|
67
|
+
}
|