@@ -259,14 +259,21 @@ export class LocalAuthService {
259259 return res ;
260260 }
261261
262- async sendSignupVerificationCode ( email : string , turnstileToken ?: string , remoteIp ?: string ) {
262+ async sendSignupVerificationCodeWithTurnstile (
263+ email : string ,
264+ turnstileToken ?: string ,
265+ remoteIp ?: string
266+ ) {
263267 this . logger . log (
264268 `Send verification code attempt - email: ${ email } , hasTurnstileToken: ${ ! ! turnstileToken } , tokenLength: ${ turnstileToken ?. length } , remoteIp: ${ remoteIp } `
265269 ) ;
266270
267271 // Validate Turnstile token if enabled
268272 await this . validateTurnstileIfEnabled ( turnstileToken , remoteIp ) ;
273+ return this . sendSignupVerificationCode ( email ) ;
274+ }
269275
276+ async sendSignupVerificationCode ( email : string ) {
270277 // Check rate limit: ensure interval between emails for the same address
271278 // Backend rate limit is configured limit - 2 seconds (to account for network latency)
272279 // If configured limit is 0, skip rate limiting entirely
@@ -278,9 +285,7 @@ export class LocalAuthService {
278285 const existingRateLimit = await this . cacheService . get ( rateLimitKey ) ;
279286
280287 if ( existingRateLimit ) {
281- this . logger . warn (
282- `Signup verification rate limit exceeded - email: ${ email } , remoteIp: ${ remoteIp } , timestamp: ${ new Date ( ) . toISOString ( ) } `
283- ) ;
288+ this . logger . warn ( `Signup verification rate limit exceeded - email: ${ email } ` ) ;
284289 throw new BadRequestException (
285290 `Please wait ${ configuredLimit } seconds before requesting a new code`
286291 ) ;
@@ -299,7 +304,7 @@ export class LocalAuthService {
299304
300305 // Log verification code sending
301306 this . logger . log (
302- `Sending signup verification code - email: ${ email } , remoteIp: ${ remoteIp } , timestamp: ${ new Date ( ) . toISOString ( ) } , turnstileVerified: ${ ! ! turnstileToken } `
307+ `Sending signup verification code - email: ${ email } , timestamp: ${ new Date ( ) . toISOString ( ) } `
303308 ) ;
304309
305310 const emailOptions = await this . mailSenderService . sendEmailVerifyCodeEmailOptions ( {
0 commit comments