This commit is contained in:
paritosh18
2025-11-14 16:33:34 +05:30
3 changed files with 1 additions and 3 deletions

View File

@@ -34,7 +34,6 @@ export async function generateOtpHelper(
otpLength === 6
? OtpGeneratorSixDigit.generateOtp()
: OtpGenerator.generateOtp();
console.log("Generated OTP:", otp);
// Hash OTP
const hashedOtp = await bcrypt.hash(otp, 10);

View File

@@ -34,7 +34,7 @@ export const handler = safeHandler(async (
select: { emailAddress: true, id: true, userPassword: true, roleXid: true },
});
if(!user || ![ROLE.MINGLAR_ADMIN, ROLE.CO_ADMIN, ROLE.ACCOUNT_MANAGER].includes(user.roleXid)){
if(!user && ![ROLE.MINGLAR_ADMIN, ROLE.CO_ADMIN, ROLE.ACCOUNT_MANAGER].includes(user.roleXid)){
throw new ApiError(403, 'You are not allowed to register directly. Please contact minglar admin.');
}

View File

@@ -119,7 +119,6 @@ export class MinglarService {
if (!existingUser) {
throw new ApiError(404, 'User not found');
}
console.log(existingUser.roleXid);
if (existingUser.roleXid !== ROLE.MINGLAR_ADMIN && existingUser.roleXid !== ROLE.CO_ADMIN && existingUser.roleXid !== ROLE.ACCOUNT_MANAGER) {
throw new ApiError(403, 'Access denied.');