Normalize email addresses to lowercase in OTP verification handler for consistent processing.

This commit is contained in:
2025-12-08 15:19:31 +05:30
parent bbd55562af
commit d5d6951e64

View File

@@ -27,8 +27,10 @@ export const handler = safeHandler(async (
throw new ApiError(400, 'Email and OTP are required');
}
await hostService.verifyHostOtp(email, otp);
const user = await hostService.getHostByEmail(email);
const emailToLowerCase = email.toLowerCase();
await hostService.verifyHostOtp(emailToLowerCase, otp);
const user = await hostService.getHostByEmail(emailToLowerCase);
const generateTokenForHost = await tokenService.generateAuthToken(
user.id
);