Auto-verify website when website domain matches email domain#3465
Auto-verify website when website domain matches email domain#3465steven-tey merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughReplaces scalar partnerId with a partner object across verification flows, adds an auto_verified outcome when partner email domain matches the website domain, updates cache/upsert keys to use partner.id, and adjusts the UI onSuccess handler to handle the new auto_verified path. Changes
Sequence Diagram(s)sequenceDiagram
actor User as Partner User
participant Form as PartnerPlatformsForm
participant Server as startPartnerPlatformVerification (Action)
participant Domain as Domain Checker
participant Cache as Cache/DB
participant DNS as DNS Provider
User->>Form: Submit platform verification (partner: {id,email}, handle, platform)
Form->>Server: Call verification action
alt Website verification path
Server->>Domain: getDomainWithoutWWW(handle) & extract partner email domain
Domain-->>Server: domains compared (exclude GENERIC_EMAIL_DOMAINS)
alt domains match
Server->>Cache: Upsert platform with verifiedAt using partner.id
Server-->>Form: Return { type: "auto_verified" }
else domains don't match
Server->>DNS: Generate TXT record for handle domain
Server->>Cache: Store verification state keyed by partner.id
Server-->>Form: Return { type: "txt_record", ... }
end
else OAuth/code verification path
Server->>Cache: Store OAuth/code state using partner.id
Server-->>Form: Return { type: "oauth" } or { type: "verification_code" }
end
Form->>Form: onSuccess handler (async)
alt auto_verified
Form->>Form: Show success toast
Form->>Cache: Mutate partner profile (refresh)
else other types
Form->>User: Show TXT/OAuth/code instructions
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review, any breaking changes? |
|
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/web/lib/actions/partners/start-partner-platform-verification.ts`:
- Around line 103-119: The auto-verification currently compares partner.email
domain to websiteHostname and can be abused with public/free email domains;
modify the logic in start-partner-platform-verification to skip
auto-verification when the email domain is a known free/disposable provider by
adding a blocklist check (e.g., a FREE_EMAIL_DOMAINS array or using a package
like free-email-domains/disposable-email-domains) before the equality check;
ensure you normalize domains (toLowerCase, trim) for both partner.email split
result and websiteHostname, and only call upsertPartnerPlatform (and return {
type: "auto_verified" }) when emailDomain === websiteHostname AND emailDomain is
not in the free-email blocklist; update/add tests for partner.email cases using
gmail/yahoo/outlook/etc. to confirm auto-verification is skipped.
Summary by CodeRabbit
New Features
Improvements