feat: Add additional checks for website, NS records and personal emails
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
import type {NextApiRequest, NextApiResponse} from 'next';
|
||||
import type {EmailVerificationResult} from '@plunk/types';
|
||||
import {UtilitySchemas} from '@plunk/shared';
|
||||
import {API_URI} from '../../lib/constants';
|
||||
|
||||
interface VerifyEmailResponse {
|
||||
email: string;
|
||||
valid: boolean;
|
||||
isDisposable: boolean;
|
||||
isTypo: boolean;
|
||||
isPlusAddressed: boolean;
|
||||
domainExists: boolean;
|
||||
hasMxRecords: boolean;
|
||||
suggestedEmail?: string;
|
||||
reasons: string[];
|
||||
}
|
||||
|
||||
interface ErrorResponse {
|
||||
error: string;
|
||||
}
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse<VerifyEmailResponse | ErrorResponse>) {
|
||||
export default async function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse<EmailVerificationResult | ErrorResponse>,
|
||||
) {
|
||||
// Only allow POST requests
|
||||
if (req.method !== 'POST') {
|
||||
return res.status(405).json({error: 'Method not allowed'});
|
||||
|
||||
@@ -4,7 +4,8 @@ import {DASHBOARD_URI} from '../../lib/constants';
|
||||
import React, {useState} from 'react';
|
||||
import {NextSeo} from 'next-seo';
|
||||
import {ArrowRight, CheckCircle, Loader2, Search} from 'lucide-react';
|
||||
import {type EmailVerificationResult as VerificationResult, verifyEmail} from '../../lib/emailVerification';
|
||||
import type {EmailVerificationResult as VerificationResult} from '@plunk/types';
|
||||
import {verifyEmail} from '../../lib/emailVerification';
|
||||
import {EmailVerificationResult} from '../../components/tools/EmailVerificationResult';
|
||||
import {Button, Input} from '@plunk/ui';
|
||||
import {EMAIL_VERIFICATION_FEATURES} from '../../lib/toolsContent';
|
||||
|
||||
Reference in New Issue
Block a user