- launch.ts policy: LAUNCH_MODE=free_early_access default; effective access = published && (free || early); intended tier (access) never rewritten - Billing off server-side: /api/subscribe 503 honest copy; subscribe CTAs render disabled 'قريباً' from first paint; /subscription early-access panel + /api/notify (LaunchNotifications) with honest 503 when mail transport off - Signup trust: verification email at signup (Users afterChange), no confirm-password, 429 message fidelity, typo suggestion, live password hint - Agent pipeline: pickFields strips access/readingMinutes, sourceId dedup, secret-scan 422 (pattern names only), string-content rejected (was silently replaced), publish stays explicit opt-in - lexical.ts: root unwrap fix — lexicalToText/countLexicalWords returned 0 for real serialized trees (secret scan + readingMinutes were inert) - llms-full.txt: fetchIndexDocs(true) — bodies were never selected - Content honesty: contentType/authorName/sourceId fields + migration, readingMinutes computed at write (160 wpm) + backfill script, byline, 'حُدّث' freshness - SEO/AI-SEO: metadata rewrite (published-only, og:image 1200x630), Article + BreadcrumbList + FAQPage + Organization JSON-LD, isAccessibleForFree honest, table renderer, robots AI-crawler policy (10 named bots), llms.txt + llms-full.txt, /topics/* hubs + sitemap, noindex auth pages, www 301 - Ops: backup-db.sh (restore rehearsed on VPS), docs copies (launch readiness + marketing audit + owner-inputs for L-03), GLOSSARY.md entries Verified: tsc --noEmit 0, npm run build 0, local smoke (ghost VIP read, subscribe/notify/agent APIs, signup token, 429 on 6th, llms/topics/sitemap, og:image/JSON-LD)
64 lines
3.1 KiB
TypeScript
64 lines
3.1 KiB
TypeScript
import Topnav from '@/components/topnav'
|
|
import Footer from '@/components/footer'
|
|
import { getPayload } from 'payload'
|
|
import { headers } from 'next/headers'
|
|
import configPromise from '@payload-config'
|
|
import Link from 'next/link'
|
|
import VerifyActions from './verify-actions'
|
|
import '../styles/email-verification.css'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
export const metadata = { title: 'تأكيد البريد الإلكتروني' }
|
|
|
|
type Props = { searchParams: Promise<{ invalid?: string }> }
|
|
|
|
/* Email verification step — design from email-verification.html. The account
|
|
was created; the user either clicks the emailed link (real SMTP at deploy)
|
|
or proceeds to onboarding via the CTA. */
|
|
export default async function VerifyEmailPage({ searchParams }: Props) {
|
|
const { invalid } = await searchParams
|
|
let email: string | null = null
|
|
let verified = false
|
|
let userId: number | null = null
|
|
try {
|
|
const payload = await getPayload({ config: configPromise })
|
|
const { user } = await payload.auth({ headers: await headers() })
|
|
if (user) {
|
|
email = user.email
|
|
verified = !!user.emailVerified
|
|
userId = Number(user.id)
|
|
}
|
|
} catch {
|
|
/* no db / no session — page still renders */
|
|
}
|
|
|
|
return (
|
|
<div id="site" className="site-page page-verify-email">
|
|
<Topnav />
|
|
<main id="content" className="verification">
|
|
<section className="container" data-od-id="email-verification">
|
|
<div className="card">
|
|
<p className="eyebrow">الخطوة التالية · تأكيد البريد</p>
|
|
<h1 data-od-id="verification-title">افتح بريدك لتفعيل الحساب.</h1>
|
|
<p className="lead">أرسلنا رابط التأكيد إلى:<strong className="email" id="signupEmail">{email ?? 'بريدك الإلكتروني'}</strong></p>
|
|
{invalid === '1' && (
|
|
<p className="status" role="alert">رابط التأكيد غير صالح أو استُخدم من قبل. اطلب رسالة جديدة.</p>
|
|
)}
|
|
{verified && (
|
|
<p className="status" role="status">بريدك الإلكتروني مؤكَّد بالفعل ✓ — تابع إلى الإعداد.</p>
|
|
)}
|
|
<ol className="steps" aria-label="خطوات تأكيد البريد">
|
|
<li><span className="step-num">01</span><span>افتح رسالة أنور بآي في صندوق الوارد.</span></li>
|
|
<li><span className="step-num">02</span><span>اضغط رابط تأكيد البريد الإلكتروني داخل الرسالة.</span></li>
|
|
<li><span className="step-num">03</span><span>افحص مجلد الرسائل غير المرغوبة (Spam).</span></li>
|
|
<li><span className="step-num">04</span><span>عد هنا لإعداد حسابك ومسارك الأول.</span></li>
|
|
</ol>
|
|
<VerifyActions verified={verified} email={email} userId={userId} />
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<Footer />
|
|
</div>
|
|
)
|
|
}
|