Merge branch 'mayank' of http://git.wdipl.com/Mayank.Mishra/MinglarBackendNestJS into paritosh
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
|
||||
|
||||
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user