Normalize email addresses to lowercase in OTP verification handler for consistent processing.
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user