@@ -12,14 +12,17 @@ import { soehne } from '@/app/fonts/soehne/soehne'
1212interface VerifyContentProps {
1313 hasEmailService : boolean
1414 isProduction : boolean
15+ isEmailVerificationEnabled : boolean
1516}
1617
1718function VerificationForm ( {
1819 hasEmailService,
1920 isProduction,
21+ isEmailVerificationEnabled,
2022} : {
2123 hasEmailService : boolean
2224 isProduction : boolean
25+ isEmailVerificationEnabled : boolean
2326} ) {
2427 const {
2528 otp,
@@ -32,7 +35,7 @@ function VerificationForm({
3235 verifyCode,
3336 resendCode,
3437 handleOtpChange,
35- } = useVerification ( { hasEmailService, isProduction } )
38+ } = useVerification ( { hasEmailService, isProduction, isEmailVerificationEnabled } )
3639
3740 const [ countdown , setCountdown ] = useState ( 0 )
3841 const [ isResendDisabled , setIsResendDisabled ] = useState ( false )
@@ -93,15 +96,17 @@ function VerificationForm({
9396 < p className = { `${ inter . className } font-[380] text-[16px] text-muted-foreground` } >
9497 { isVerified
9598 ? 'Your email has been verified. Redirecting to dashboard...'
96- : hasEmailService
97- ? `A verification code has been sent to ${ email || 'your email' } `
98- : ! isProduction
99- ? 'Development mode: Check your console logs for the verification code'
100- : 'Error: Invalid API key configuration' }
99+ : ! isEmailVerificationEnabled
100+ ? 'Email verification is disabled. Redirecting to dashboard...'
101+ : hasEmailService
102+ ? `A verification code has been sent to ${ email || 'your email' } `
103+ : ! isProduction
104+ ? 'Development mode: Check your console logs for the verification code'
105+ : 'Error: Email verification is enabled but no email service is configured' }
101106 </ p >
102107 </ div >
103108
104- { ! isVerified && (
109+ { ! isVerified && isEmailVerificationEnabled && (
105110 < div className = { `${ inter . className } mt-8 space-y-8` } >
106111 < div className = 'space-y-6' >
107112 < p className = 'text-center text-muted-foreground text-sm' >
@@ -245,10 +250,18 @@ function VerificationFormFallback() {
245250 )
246251}
247252
248- export function VerifyContent ( { hasEmailService, isProduction } : VerifyContentProps ) {
253+ export function VerifyContent ( {
254+ hasEmailService,
255+ isProduction,
256+ isEmailVerificationEnabled,
257+ } : VerifyContentProps ) {
249258 return (
250259 < Suspense fallback = { < VerificationFormFallback /> } >
251- < VerificationForm hasEmailService = { hasEmailService } isProduction = { isProduction } />
260+ < VerificationForm
261+ hasEmailService = { hasEmailService }
262+ isProduction = { isProduction }
263+ isEmailVerificationEnabled = { isEmailVerificationEnabled }
264+ />
252265 </ Suspense >
253266 )
254267}
0 commit comments