@@ -9,9 +9,12 @@ import { Input } from '@/components/ui/input'
99import { Label } from '@/components/ui/label'
1010import { client } from '@/lib/auth-client'
1111import { quickValidateEmail } from '@/lib/email/validation'
12+ import { createLogger } from '@/lib/logs/console/logger'
1213import { cn } from '@/lib/utils'
1314import { SocialLoginButtons } from '@/app/(auth)/components/social-login-buttons'
1415
16+ const logger = createLogger ( 'SignupForm' )
17+
1518const PASSWORD_VALIDATIONS = {
1619 minLength : { regex : / .{ 8 , } / , message : 'Password must be at least 8 characters long.' } ,
1720 uppercase : {
@@ -281,7 +284,7 @@ function SignupFormContent({
281284 } ,
282285 {
283286 onError : ( ctx ) => {
284- console . error ( 'Signup error:' , ctx . error )
287+ logger . error ( 'Signup error:' , ctx . error )
285288 const errorMessage : string [ ] = [ 'Failed to create account' ]
286289
287290 if ( ctx . error . code ?. includes ( 'USER_ALREADY_EXISTS' ) ) {
@@ -343,10 +346,21 @@ function SignupFormContent({
343346 }
344347 }
345348
349+ // Send verification OTP manually
350+ try {
351+ await client . emailOtp . sendVerificationOtp ( {
352+ email : emailValue ,
353+ type : 'email-verification' ,
354+ } )
355+ } catch ( otpError ) {
356+ logger . error ( 'Failed to send OTP:' , otpError )
357+ // Continue anyway - user can use resend button
358+ }
359+
346360 // Always redirect to verification for new signups
347361 router . push ( '/verify?fromSignup=true' )
348362 } catch ( error ) {
349- console . error ( 'Signup error:' , error )
363+ logger . error ( 'Signup error:' , error )
350364 setIsLoading ( false )
351365 }
352366 }
0 commit comments