Skip to content

Commit

Permalink
removed college email check
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulambastha committed Mar 30, 2024
1 parent 0fc3a01 commit a2a0b45
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ const registerUser = expressAsync(async (req, res) => {
console.log("register user called")
const {username, email, firstName, lastName} = req.body

const emailRegex = (emailToTest) => {
// Regular expression pattern for the specified format
const pattern = /^[0-9]{2}[a-zA-Z]{3}[0-9]{3}@nith\.ac\.in$/;

// Test the email against the pattern
return pattern.test(emailToTest);
}

if (!emailRegex(email)) {
res.status(422).json({err: 'enter college email'})
return
}
// const emailRegex = (emailToTest) => {
// // Regular expression pattern for the specified format
// const pattern = /^[0-9]{2}[a-zA-Z]{3}[0-9]{3}@nith\.ac\.in$/;

// // Test the email against the pattern
// return pattern.test(emailToTest);
// }

// if (!emailRegex(email)) {
// res.status(422).json({err: 'enter college email'})
// return
// }

const encryptText = (text, key) => {
const encrypted = CryptoJS.AES.encrypt(text, key);
Expand Down

0 comments on commit a2a0b45

Please sign in to comment.