From dab63f676a85e630d48bb46a6ff7ce269d86d45d Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 9 Sep 2024 08:25:46 +0530 Subject: [PATCH] fixed cookie parser and typo error in cookie token --- .gitignore | 6 +- index.js | 3 +- package-lock.json | 526 ++++++++++++++-------------- src/controllers/groupController.js | 4 +- src/controllers/userController.js | 16 +- src/db/db.js | 8 +- src/models/userModel.js | 2 +- src/routes/groupRoute.js | 9 + src/routes/userRoute.js | 12 +- src/services/emailsenderProducer.js | 4 +- src/services/redisServer.js | 11 +- src/services/totpAuth.js | 2 +- src/utils/cookieToken.js | 3 +- src/utils/isContactsValid.js | 8 +- 14 files changed, 308 insertions(+), 306 deletions(-) create mode 100644 src/routes/groupRoute.js diff --git a/.gitignore b/.gitignore index f480d7d..9d7dc69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ /node_modules .env -/profile_photo \ No newline at end of file +/profile_photo + + +#ignore specific file +src/utils/constants.js \ No newline at end of file diff --git a/index.js b/index.js index 959d97e..e4a859e 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ app.use(express.urlencoded({ extended: true })); app.use(express.json()); // cookie parser Middleware -app.use(cookieParser); +app.use(cookieParser()); // HTTP request logger middleware app.use(morgan("tiny")); @@ -33,7 +33,6 @@ const userRoute = require("./src/routes/userRoute"); // user route middleware app.use("/user/new", userRoute); -app.use("/user/verify", userRoute); const server = app.listen(PORT, () => { console.log(`server is running on the port: ${PORT}`); diff --git a/package-lock.json b/package-lock.json index c2f419b..03700d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -932,14 +932,14 @@ } }, "node_modules/@jimp/core": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/core/-/core-1.3.0.tgz", - "integrity": "sha512-3+ndSrQYQxyyKyUSdXyk29vHt9vc3zg+3aFrVX2RHzAMeLdjkQHqzQc/7v6VxRk6BtOh1v/VPtmsXHXVg1vVhA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/core/-/core-1.4.0.tgz", + "integrity": "sha512-bMjZOoMyDuM9t16qG5vcSWlh75u+ygG+QBrQg55CBAGn71BFpGUcfn2EvtNKhWz1MaJgpKC047WHlOmrQBR8og==", "license": "MIT", "dependencies": { - "@jimp/file-ops": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/file-ops": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "await-to-js": "^3.0.0", "exif-parser": "^0.1.12", "file-type": "^16.0.0", @@ -949,27 +949,15 @@ "node": ">=18" } }, - "node_modules/@jimp/core/node_modules/mime": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", - "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/@jimp/diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/diff/-/diff-1.3.0.tgz", - "integrity": "sha512-eGFfZi8UjSZ6gGu9kpQmGPRRDt5fMV3V1qKRn0cTqtBsECAnKPG5PPT1dvnjDDBbtAOH81jhIr//ko8H5WV8jg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/diff/-/diff-1.4.0.tgz", + "integrity": "sha512-PpHiYx5rw8Is5MeKvuOX5rgGr1W1R6kRIlZtJ0Fg6kHT610oFcSZj65/rea9cQ2MmJgTbO09r9mEoHMcqNouiw==", "license": "MIT", "dependencies": { - "@jimp/plugin-resize": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "pixelmatch": "^5.3.0" }, "engines": { @@ -977,23 +965,23 @@ } }, "node_modules/@jimp/file-ops": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/file-ops/-/file-ops-1.3.0.tgz", - "integrity": "sha512-DzbSLgUdOGT9T9qf+Ik/hBA8e4zA9tWyHnJJA/N9sJHwHNDCMtoaX3KY5ssHuRGmcngGKLwbeGjddnZXF4oIVA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/file-ops/-/file-ops-1.4.0.tgz", + "integrity": "sha512-9a4+VXGAQ29eVc+lXd2Edy5O6Cflv50EuwWm9bcU317iYo44Ro4NlG25JBL+Cu8BcSq8Fh/TjQdkBAigTlMB8g==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@jimp/js-bmp": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/js-bmp/-/js-bmp-1.3.0.tgz", - "integrity": "sha512-sc3jvJJOMHoUtP9mlnuBCkwhHy9T2KiSfdV3XKg81v+bg9O0LudB33v3Y0dtGxSo/WOL2V6PVNIWTRf7gu+hJw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/js-bmp/-/js-bmp-1.4.0.tgz", + "integrity": "sha512-hngoxEXL7X7+tgylUiXK4vwXpzXTfQSXcLsBC2M7wJ/ODU0qcVe62XqzLY+BOPLym6SYxwjJ9Zeap+xTJyNwkA==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "bmp-ts": "^1.0.9" }, "engines": { @@ -1001,13 +989,13 @@ } }, "node_modules/@jimp/js-gif": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/js-gif/-/js-gif-1.3.0.tgz", - "integrity": "sha512-hhAd/TpZSp6AIuRjYKFGGEsu9HzQG16Q9lZHPcTZz1TlxtTUqW60AJvFrGvnUZbTecDj3JnI3TipX8aeqZpBDg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/js-gif/-/js-gif-1.4.0.tgz", + "integrity": "sha512-aaBGArc8yQhZCrqQ02m1+wzlVIg3lEmLDzwgzYY5WnoAOLpvkVzRj1M3WV17Bu8v3AzWkO1izapKTHo6Hb7cvg==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", "gifwrap": "^0.10.1", "omggif": "^1.0.10" }, @@ -1016,13 +1004,13 @@ } }, "node_modules/@jimp/js-jpeg": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/js-jpeg/-/js-jpeg-1.3.0.tgz", - "integrity": "sha512-SrZL35FvKsgySS5kpqYWbVsi0rswcgxw3oRTVOy55q8F045fE4U0YqlnRdkg77dxdahUOIWVhvn5+0V+Re5F5A==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/js-jpeg/-/js-jpeg-1.4.0.tgz", + "integrity": "sha512-vIRXccEs64TIpbHiFX3AuNCcREsTPLA09yxQWcs6EGRMQhIpyeatqIYC4L8bAhOGHW/uI8hNWZiuXWwPByxfkA==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", "jpeg-js": "^0.4.4" }, "engines": { @@ -1030,36 +1018,27 @@ } }, "node_modules/@jimp/js-png": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/js-png/-/js-png-1.3.0.tgz", - "integrity": "sha512-9x8uFueVupNocQQ5WEFat61M31MdRDV7O3QBDR2iEsbVeQ1+LE9Tvvm9r1PG9W91KZYzG4IYPPsogQ0TFEixqA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/js-png/-/js-png-1.4.0.tgz", + "integrity": "sha512-nBYqmXRkhw97xCbCihYGU5RiWfRYtsjAT2/lxcMqItOFkNEODDnx3aUG4R1LZYPfG1/1Z+Fok15L+FQL1JxD1g==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", "pngjs": "^7.0.0" }, "engines": { "node": ">=18" } }, - "node_modules/@jimp/js-png/node_modules/pngjs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", - "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", - "license": "MIT", - "engines": { - "node": ">=14.19.0" - } - }, "node_modules/@jimp/js-tiff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/js-tiff/-/js-tiff-1.3.0.tgz", - "integrity": "sha512-uin5WkVm0M8ZgotIANXU0sfVkNApsKws1ZSqsc9NZf0MYJsZkz/w8D4ld6hXkFCEQcJ/TMu7aeMZSP+I8cbmOg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/js-tiff/-/js-tiff-1.4.0.tgz", + "integrity": "sha512-WJcNBKBk1C14la4xMa3VLgc23G136eMiy9rGS1a8SBc16e7915J5kiMRpVrg6noenzb+8oN0RE5LGE5X+/BCQA==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", "utif2": "^4.1.0" }, "engines": { @@ -1067,13 +1046,13 @@ } }, "node_modules/@jimp/plugin-blit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-1.3.0.tgz", - "integrity": "sha512-5OjEUM0jtzQ6KJBTougs8ozbUAxYyJiKZqceFb8mqKVMjuiM94N9425mIDDgOl5MDFwAESeTMIchKCAPMOv2FQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-1.4.0.tgz", + "integrity": "sha512-eHg4MCCdMOnZ70/TsbObz+0wCY1qKMlRPjTqWGgfjoT/harjjZveV2j9gCNofGVcyscV7b5S6It7p0f6LcwmPA==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1081,25 +1060,25 @@ } }, "node_modules/@jimp/plugin-blur": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.3.0.tgz", - "integrity": "sha512-108RHeCvHFJqpQvuaydhxwJLBwdjEWKLW6ZXWWCnCadrpKbH2yqu9P6oUhHS7atLjQ0ZBzXcM+Wj2VYR7XU8ng==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.4.0.tgz", + "integrity": "sha512-rMblWcCMYtaaFv+6UD4EupyOm7i7tWNxdvm+lqrcquKF54vfw9JtvywrmEX4CBCUoKGSIlFHFj8HH8IFDW6MJQ==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/utils": "1.3.0" + "@jimp/core": "1.4.0", + "@jimp/utils": "1.4.0" }, "engines": { "node": ">=18" } }, "node_modules/@jimp/plugin-circle": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-1.3.0.tgz", - "integrity": "sha512-Lkz1uwD2wgysuu4TDzAVQ26+urr+siYlO/qXnMYHui9k0P735S6B6EsWrzssLDGOtqevQyYcx5u6h0Kv4lzehg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-1.4.0.tgz", + "integrity": "sha512-wVMTUak3SnozmNHDfjWCk8dhfo02+5DNdhNoajcP+keL9i++TNOw/0bWNBJhS6YyHXmL85QWpA3tp62bLs88Fw==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", + "@jimp/types": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1107,14 +1086,14 @@ } }, "node_modules/@jimp/plugin-color": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.3.0.tgz", - "integrity": "sha512-HLFtZB86W2nVnfZT+LAsyooF9efapWPmxuOKECeevunb1zHieO1ni19QXJfcqtt+cVj8UxIBGC4v9IFDJ9PGYw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.4.0.tgz", + "integrity": "sha512-YnTqQP7SyKvW0eu2KeKB5lMUnYSNMHFNzw15A3paq4YBeG21wpyqXiZzpGjJmwEVlRo35JqkWjP2++O3HW/Pqw==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "tinycolor2": "^1.6.0", "zod": "^3.23.8" }, @@ -1123,16 +1102,16 @@ } }, "node_modules/@jimp/plugin-contain": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.3.0.tgz", - "integrity": "sha512-1xPJ/CC4hh8IDrZFCtwQezw0RFzdrFvatzXkmfZD0cRyUXtYQ8VzExeK9MXLWi2+/nfufh+2SIhThTQ8xIzLBw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.4.0.tgz", + "integrity": "sha512-20IFdQ4SYFEas8OEstHfNTm6IBAXRuyClbEQF51vmVcAIL2IMNoxkzwNZqcOMhNA6Ug4dMHfRP2DFWvu0UEtnQ==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/plugin-blit": "1.3.0", - "@jimp/plugin-resize": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/plugin-blit": "1.4.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1140,15 +1119,15 @@ } }, "node_modules/@jimp/plugin-cover": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.3.0.tgz", - "integrity": "sha512-Q8vlXepruKU+A55PS2A+d7TPwIoYthnX61ae+TQa+/4DjYk6XZA2YlmUFhq7P3RH5p288N/84ILNSIwH5YCqAw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.4.0.tgz", + "integrity": "sha512-pzcuTSyF4gaVuGlLfhghk33hELVITq+trdgBgLzq9P2RoNUrq7PrtzS4N/aAWHeQFXTHhr83FSdEHGUQX7dG0A==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/plugin-crop": "1.3.0", - "@jimp/plugin-resize": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/plugin-crop": "1.4.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/types": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1156,14 +1135,14 @@ } }, "node_modules/@jimp/plugin-crop": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.3.0.tgz", - "integrity": "sha512-AoCTYFgcDEH+sqc2IQ5CI0CgYrQZSFfZ6q4zSXkWA+irs1nDbjJeA+0vClkYxJNSkk2wqB0fys69OBoqfDabrw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.4.0.tgz", + "integrity": "sha512-VlprZvjbMMo860/vk557SMiKKnhqEliJ/IKv/4PuXcJQqEFUQYelege/gmmLYCOSLypY5jt39UIkQG7RjgIcOg==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1171,13 +1150,13 @@ } }, "node_modules/@jimp/plugin-displace": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.3.0.tgz", - "integrity": "sha512-8t/R0SjE7YWujeMLbUT2js9WIeyFbeQXxAiCPt4AJy1BUD56sbcWIx1zJzrL52eF+bG4AS8oLOp5arL+P7ocmQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.4.0.tgz", + "integrity": "sha512-eBlVY/ewbBlRK8nEAoAmf0OCpJGD+T1zl42ZaVmEbWYW4IRb51bLhBeZDMKEKT6cN9kb8xn6rYqj3peCgDCv4A==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1185,25 +1164,25 @@ } }, "node_modules/@jimp/plugin-dither": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.3.0.tgz", - "integrity": "sha512-oE6kHne88OOcJBu+fk9KvMMB71UZUO4B2YYoaHVjGbtciPG9FbBBGqgD9oULVWhHuICZdDnfgFF0hhemQuQloQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.4.0.tgz", + "integrity": "sha512-msVgcWpuHoU0+A4feHTGMHFLhHCulVP1FwCp8KWt07o9gQG2jxH8tiF5Ki/aM7cF+GXfZIbfVj+FCVytuVMsig==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0" + "@jimp/types": "1.4.0" }, "engines": { "node": ">=18" } }, "node_modules/@jimp/plugin-fisheye": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-1.3.0.tgz", - "integrity": "sha512-VLaqY/IxrqHyjKeWpUwJZpAqug4DE26hM/8ejfPm5FmofAS1dI0deecDfbthRbw17hnPVcAiTkZ6QTiQL71Z4w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-1.4.0.tgz", + "integrity": "sha512-j/VI/EiBzIwiR+O2ajBm3qzebseO+4ePzG4IKAIs9qgOtT5cc6LZF+xdEr0bp8Qe8sAnwH6aTQi6k1AoclY1rg==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1211,12 +1190,12 @@ } }, "node_modules/@jimp/plugin-flip": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.3.0.tgz", - "integrity": "sha512-cHeefBsjBYLbjqq8TFJHQD/6sgJLvb6XPdB8wVvKe682Y8jIilxlEhZJeUFXwsMrKKhbXNZxmtSc/pEIYCo6cA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.4.0.tgz", + "integrity": "sha512-yBmmTyLrPEYEd5WPGpVT3MQwx6ekjSsyALv2XZHaxXK/ALJa4S74byMhXgD2z7u3aXvCryx7yW7Fb7LcTYukVA==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", + "@jimp/types": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1224,20 +1203,20 @@ } }, "node_modules/@jimp/plugin-hash": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.3.0.tgz", - "integrity": "sha512-LAUi9FFT3Kp2bI2hWXQ75t1pl6q6ZyKH/jJQZg8DPL+fFK0//TIsw/g0VxW5lZoV3mHUUorQlsZzWtNi/DGtWA==", - "license": "MIT", - "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/js-bmp": "1.3.0", - "@jimp/js-jpeg": "1.3.0", - "@jimp/js-png": "1.3.0", - "@jimp/js-tiff": "1.3.0", - "@jimp/plugin-color": "1.3.0", - "@jimp/plugin-resize": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.4.0.tgz", + "integrity": "sha512-CdqXHxHL7GmQm9L9ZtLP4BtdmIC8z4vAYS1fqX/rRuBTWmRGN+1fN/UbtwDvnuedeFgImE2sq8XxUUmVRVC5ZQ==", + "license": "MIT", + "dependencies": { + "@jimp/core": "1.4.0", + "@jimp/js-bmp": "1.4.0", + "@jimp/js-jpeg": "1.4.0", + "@jimp/js-png": "1.4.0", + "@jimp/js-tiff": "1.4.0", + "@jimp/plugin-color": "1.4.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "any-base": "^1.1.0" }, "engines": { @@ -1245,12 +1224,12 @@ } }, "node_modules/@jimp/plugin-mask": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-1.3.0.tgz", - "integrity": "sha512-fpU6rZ75c1gD6/8zsiPQW57+doX3KfexZ3lVYToyd720HPO/qfG9lzwfY30tJVXArI4DMbG8qN7lXKgGeWwGqw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-1.4.0.tgz", + "integrity": "sha512-92Rei2zkXFsXM6st0AjiWRplNZ2cwVq7dGU5SVqtM5LGnqK6HJDkZXWk9zp82+eajHSTye+EZ+6Xj5Sn4nMPsw==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", + "@jimp/types": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1258,16 +1237,16 @@ } }, "node_modules/@jimp/plugin-print": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.3.0.tgz", - "integrity": "sha512-WeN35Fo9Bushm6VGUdQXqXrVIFDYECeKLKN+LlAqQ/YnIlUiTirPlcyGHzEBKD8uXDCmjBYqxwadcPvRDVwFEw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.4.0.tgz", + "integrity": "sha512-GZYW6zmp9g8T7G0pNO1x/AjxHX7R1zu0+6iJBHZgyrCkaTluFd6D7448ZUHMzmNOCcmlSNI8bJ+PhUk2V3hU5A==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/js-jpeg": "1.3.0", - "@jimp/js-png": "1.3.0", - "@jimp/plugin-blit": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/js-jpeg": "1.4.0", + "@jimp/js-png": "1.4.0", + "@jimp/plugin-blit": "1.4.0", + "@jimp/types": "1.4.0", "parse-bmfont-ascii": "^1.0.6", "parse-bmfont-binary": "^1.0.6", "parse-bmfont-xml": "^1.1.6", @@ -1279,9 +1258,9 @@ } }, "node_modules/@jimp/plugin-quantize": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.3.0.tgz", - "integrity": "sha512-4Hgp5UNN8DGeX1ULNANPwlHCyuaZYZPJ/mpe/lnCN4jLI/SeBzR4g8tU+srNF6arPwRXrLNQV6T/ehAa7zhbkg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.4.0.tgz", + "integrity": "sha512-3A8Omq8EzyRHz7iObeSVHXflMDK8W9pOh0pKDbdCYAAQfH60jElZ4aiC7g4XPeR+C+XxDO4vSQlC/LhbkmV0ig==", "license": "MIT", "dependencies": { "image-q": "^4.0.0", @@ -1292,13 +1271,13 @@ } }, "node_modules/@jimp/plugin-resize": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.3.0.tgz", - "integrity": "sha512-9fMw6ff/3kzDwQ2rGNYCJ2jc9IHsxQh9eaoPb4SkVHxzq+O3yka3M2Vjf41gaYhQ5Pt5QLgQ9uYUA+2kp1RF1g==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.4.0.tgz", + "integrity": "sha512-Y+FQzJ/k79EJYSqn8yabtgshthHNHMpTZWIrlazugplNk+PjDlMQ5Hu7PVYUus+GxX8wzf1PSG0wPY3gVilwTA==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/types": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/types": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1306,16 +1285,16 @@ } }, "node_modules/@jimp/plugin-rotate": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.3.0.tgz", - "integrity": "sha512-lpzk37tzk7b5RG5U6P/E3vk+bwU86TnNZOc1LHQeTOEpfFAPMTJl6w+OlLLxVNJ7HUQege/8P47N2onQX00wXw==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.4.0.tgz", + "integrity": "sha512-mvDTeXvonkKWC1T98CljbjazR40CZVMdgtn5R8giPp16745PC3WFy+kA3PocMXg3EAwK4+I9Hh6r7Y4VRsa4fw==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/plugin-crop": "1.3.0", - "@jimp/plugin-resize": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/plugin-crop": "1.4.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1323,16 +1302,16 @@ } }, "node_modules/@jimp/plugin-threshold": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.3.0.tgz", - "integrity": "sha512-lKBzZEgjI/zM51/muGyL2juGEkK361/yFpRcmjafIijq0sHNww1rhqSa0AhO80iCmN77A4Ym/oelY0qh4mtlLQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.4.0.tgz", + "integrity": "sha512-AvbIZenfMpOIoF2pnUtNo7SsNt4z2VSyrKFa0BIiodpUBdxujkBRq/FO/jNLnxaN6ShhVudBgRX6AJB4+hzITQ==", "license": "MIT", "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/plugin-color": "1.3.0", - "@jimp/plugin-hash": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0", + "@jimp/core": "1.4.0", + "@jimp/plugin-color": "1.4.0", + "@jimp/plugin-hash": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0", "zod": "^3.23.8" }, "engines": { @@ -1340,9 +1319,9 @@ } }, "node_modules/@jimp/types": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.3.0.tgz", - "integrity": "sha512-K4RaTmDTqZqbjjwOtxzVH9QyCgQBukXjKOmdgNuCmu7ugrpeTeWV7SvrwZZPhTt31lmja8A3a3Dw1ScVZdtmyA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.4.0.tgz", + "integrity": "sha512-EWIsQxRgBBvkkkZ81iVQLpb+V5Y1wNyrqUl5w56ZwT7HaJGGJz9EU1TYcUhxq1q2jQJLeNMScfJbUTZv7y3Ehw==", "license": "MIT", "dependencies": { "zod": "^3.23.8" @@ -1352,12 +1331,12 @@ } }, "node_modules/@jimp/utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.3.0.tgz", - "integrity": "sha512-QIye6IWJaQ3Q9+6rxgQiFI1I7MwrQZYxlhYhPolJv+BfCXBT8XWJymV8J75vlnjvz3kN2AMXAEU7c7w0h2Tz3Q==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.4.0.tgz", + "integrity": "sha512-WXqOq/x1SjyY2QaMDdjaStYLICN4Uie9pSswrQSBqFLgO/m9xEdwFNnhLQDhwqqDUlQ4NnDIdAUUTihmdO2p8g==", "license": "MIT", "dependencies": { - "@jimp/types": "1.3.0", + "@jimp/types": "1.4.0", "tinycolor2": "^1.6.0" }, "engines": { @@ -1365,9 +1344,9 @@ } }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", - "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" @@ -2228,9 +2207,9 @@ } }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -2504,9 +2483,9 @@ } }, "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2525,15 +2504,6 @@ "node": ">= 0.8.0" } }, - "node_modules/cookie-parser/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", @@ -2770,6 +2740,15 @@ "express": "4 || 5 || ^5.0.0-beta.1" } }, + "node_modules/express/node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/fast-xml-parser": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", @@ -2854,9 +2833,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "funding": [ { "type": "individual", @@ -3206,38 +3185,38 @@ } }, "node_modules/jimp": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jimp/-/jimp-1.3.0.tgz", - "integrity": "sha512-eJnVMuqDQ545taNLp13gVZynnoOvE0xZ2Oti9alkld47dNhmFHBmFTBMTYaZr7zceGTf54RGdr7C4d2WUNwc0g==", - "license": "MIT", - "dependencies": { - "@jimp/core": "1.3.0", - "@jimp/diff": "1.3.0", - "@jimp/js-bmp": "1.3.0", - "@jimp/js-gif": "1.3.0", - "@jimp/js-jpeg": "1.3.0", - "@jimp/js-png": "1.3.0", - "@jimp/js-tiff": "1.3.0", - "@jimp/plugin-blit": "1.3.0", - "@jimp/plugin-blur": "1.3.0", - "@jimp/plugin-circle": "1.3.0", - "@jimp/plugin-color": "1.3.0", - "@jimp/plugin-contain": "1.3.0", - "@jimp/plugin-cover": "1.3.0", - "@jimp/plugin-crop": "1.3.0", - "@jimp/plugin-displace": "1.3.0", - "@jimp/plugin-dither": "1.3.0", - "@jimp/plugin-fisheye": "1.3.0", - "@jimp/plugin-flip": "1.3.0", - "@jimp/plugin-hash": "1.3.0", - "@jimp/plugin-mask": "1.3.0", - "@jimp/plugin-print": "1.3.0", - "@jimp/plugin-quantize": "1.3.0", - "@jimp/plugin-resize": "1.3.0", - "@jimp/plugin-rotate": "1.3.0", - "@jimp/plugin-threshold": "1.3.0", - "@jimp/types": "1.3.0", - "@jimp/utils": "1.3.0" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jimp/-/jimp-1.4.0.tgz", + "integrity": "sha512-TZNtWCHhT3Ghw4Z0PC9P4TFhwWM/nKhiLtXW1R3y+sQVVd4SvZsXbMoeAqq95K0Y5f4Xq4fC4CHzrJYfolHqRw==", + "license": "MIT", + "dependencies": { + "@jimp/core": "1.4.0", + "@jimp/diff": "1.4.0", + "@jimp/js-bmp": "1.4.0", + "@jimp/js-gif": "1.4.0", + "@jimp/js-jpeg": "1.4.0", + "@jimp/js-png": "1.4.0", + "@jimp/js-tiff": "1.4.0", + "@jimp/plugin-blit": "1.4.0", + "@jimp/plugin-blur": "1.4.0", + "@jimp/plugin-circle": "1.4.0", + "@jimp/plugin-color": "1.4.0", + "@jimp/plugin-contain": "1.4.0", + "@jimp/plugin-cover": "1.4.0", + "@jimp/plugin-crop": "1.4.0", + "@jimp/plugin-displace": "1.4.0", + "@jimp/plugin-dither": "1.4.0", + "@jimp/plugin-fisheye": "1.4.0", + "@jimp/plugin-flip": "1.4.0", + "@jimp/plugin-hash": "1.4.0", + "@jimp/plugin-mask": "1.4.0", + "@jimp/plugin-print": "1.4.0", + "@jimp/plugin-quantize": "1.4.0", + "@jimp/plugin-resize": "1.4.0", + "@jimp/plugin-rotate": "1.4.0", + "@jimp/plugin-threshold": "1.4.0", + "@jimp/types": "1.4.0", + "@jimp/utils": "1.4.0" }, "engines": { "node": ">=18" @@ -3392,15 +3371,15 @@ } }, "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", "license": "MIT", "bin": { "mime": "cli.js" }, "engines": { - "node": ">=4" + "node": ">=10.0.0" } }, "node_modules/mime-db": { @@ -3447,9 +3426,9 @@ } }, "node_modules/mongodb": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.7.0.tgz", - "integrity": "sha512-TMKyHdtMcO0fYBNORiYdmM25ijsHs+Njs963r4Tro4OQZzqYigAzYQouwWRg4OIaiLRUEGUh/1UAcH5lxdSLIA==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", + "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.5", @@ -3503,14 +3482,14 @@ } }, "node_modules/mongoose": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.5.3.tgz", - "integrity": "sha512-OubSDbsAclDFGHjV82MsKyIGQWFc42Ot1l+0dhRS6U9xODM7rm/ES/WpOQd8Ds9j0Mx8QzxZtrSCnBh6o9wUqw==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.6.1.tgz", + "integrity": "sha512-dppGcYqvsdg+VcnqXR5b467V4a+iNhmvkfYNpEPi6AjaUxnz6ioEDmrMLOi+sOWjvoHapuwPOigV4f2l7HC6ag==", "license": "MIT", "dependencies": { "bson": "^6.7.0", "kareem": "2.6.3", - "mongodb": "6.7.0", + "mongodb": "6.8.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -3580,12 +3559,12 @@ } }, "node_modules/mquery/node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3597,9 +3576,9 @@ } }, "node_modules/mquery/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/ms": { @@ -3618,9 +3597,9 @@ } }, "node_modules/nodemailer": { - "version": "6.9.14", - "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.14.tgz", - "integrity": "sha512-Dobp/ebDKBvz91sbtRKhcznLThrKxKt97GI2FAlAyy+fk19j73Uz3sBXolVtmcXjaorivqsbbbjDY+Jkt4/bQA==", + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.15.tgz", + "integrity": "sha512-AHf04ySLC6CIfuRtRiEYtGEXgRfa6INgWGluDhnxTZhHSKvrBu7lc1VVchQ0d8nPc4cFaZoPq8vkyNoZr0TpGQ==", "license": "MIT-0", "engines": { "node": ">=6.0.0" @@ -3656,13 +3635,13 @@ } }, "node_modules/nodemon/node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3674,9 +3653,9 @@ } }, "node_modules/nodemon/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, @@ -3865,12 +3844,12 @@ } }, "node_modules/pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", "license": "MIT", "engines": { - "node": ">=10.13.0" + "node": ">=14.19.0" } }, "node_modules/proxy-addr": { @@ -3925,6 +3904,15 @@ "node": ">=10.13.0" } }, + "node_modules/qrcode/node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -4119,6 +4107,18 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/src/controllers/groupController.js b/src/controllers/groupController.js index a9f688c..ca95c05 100644 --- a/src/controllers/groupController.js +++ b/src/controllers/groupController.js @@ -4,6 +4,4 @@ const groupModel = require("../models/groupModel"); module.exports.createGroup = async (req, res) => {}; // TODO: implement the join group func wrt to frontend design -module.exports.joinGroup = async (req, res) => { - -}; +module.exports.joinGroup = async (req, res) => {}; diff --git a/src/controllers/userController.js b/src/controllers/userController.js index 5e4d94f..9821d94 100644 --- a/src/controllers/userController.js +++ b/src/controllers/userController.js @@ -30,7 +30,9 @@ module.exports.register = async (req, res) => { } try { - const emailVerificationResult = await verifyEmail(email); + // Run email and phone verifications in parallel + const [emailVerificationResult, phoneVerificationResult] = + await Promise.all([verifyEmail(email), verifyPhone(phone)]); // Handling the verificationResult if (emailVerificationResult.status != "valid") { @@ -39,8 +41,6 @@ module.exports.register = async (req, res) => { }); } - const phoneVerificationResult = await verifyPhone(phone); - // Handling the phone verification result if (phoneVerificationResult.status != "VALID_CONFIRMED") { return res.status(400).json({ @@ -59,6 +59,8 @@ module.exports.register = async (req, res) => { // Generate verification code and save this to redis with TTL of 3 minutes await storeuser(name, email); + // TODO: Fix the queue imports and how they are used + // Queue email for sending verification code const emailContent = await sendVerificationCode(email); await queueEmailSending({ @@ -67,8 +69,6 @@ module.exports.register = async (req, res) => { html: emailContent, }); - await sendVerificationCode(email); - // Create the user const user = await User.create({ name, @@ -77,15 +77,13 @@ module.exports.register = async (req, res) => { phone, }); await user.save(); - // Don't send password in the response body - password = undefined; const token = await user.createJwtToken(); res.status(200).json({ message: "User created successfully", token, - user, + user: { name: user.name, email: user.email, phone: user.phone }, }); } catch (error) { console.error("Error during registration:", error); @@ -242,7 +240,7 @@ exports.resendVerificationEmail = async (req, res) => { } // Store user in Redis and get a new verification code - const verificationCode = await storeuser(user.name, email); + await storeuser(user.name, email); // Generate email content and queue the email for sending const emailContent = await sendVerificationCode(email); diff --git a/src/db/db.js b/src/db/db.js index 9491597..340d4c7 100644 --- a/src/db/db.js +++ b/src/db/db.js @@ -1,11 +1,5 @@ const mongoose = require("mongoose"); -// Connection options -const options = { - useNewUrlParser: true, - useUnifiedTopology: true, -}; - // Retry options // const retryOptions = { // maxAttempt: 5, @@ -16,7 +10,7 @@ const options = { // Connect to MongoDB without retry logic for dev env function connectDB() { mongoose - .connect(process.env.DB_URI, options) + .connect(process.env.DB_URI) .then(() => { console.log(`Connected to MongoDB successfully`); }) diff --git a/src/models/userModel.js b/src/models/userModel.js index 1dcaaff..cca5391 100644 --- a/src/models/userModel.js +++ b/src/models/userModel.js @@ -1,6 +1,6 @@ const bcrypt = require("bcryptjs"); const mongoose = require("mongoose"); -const JWT = require("jsonwebtoken"); +const jwt = require("jsonwebtoken"); const userSchema = new mongoose.Schema({ name: { diff --git a/src/routes/groupRoute.js b/src/routes/groupRoute.js new file mode 100644 index 0000000..990825c --- /dev/null +++ b/src/routes/groupRoute.js @@ -0,0 +1,9 @@ +const express = require("express"); +const router = express.Router(); +const limitRoute = require("../middlewares/limiterMiddleware"); +const auth = require("../middlewares/authMiddleware"); +const { joinGroup } = require("../controllers/groupController"); + +router.post("/group/join", joinGroup); + +module.exports = router; diff --git a/src/routes/userRoute.js b/src/routes/userRoute.js index ed8ee22..b0d87f5 100644 --- a/src/routes/userRoute.js +++ b/src/routes/userRoute.js @@ -1,10 +1,11 @@ const express = require("express"); const router = express.Router(); const limitRoute = require("../middlewares/limiterMiddleware"); +const auth = require("../middlewares/authMiddleware"); const { register, - verifyCode, + verifyEmail, login, logout, handleUserChoice, @@ -12,10 +13,13 @@ const { router.post("/register", register); router.post("/login", limitRoute, login); -router.post("/verify-mail", verifyCode); +router.post("/verify", verifyEmail); router.post("/logout", logout); -router.post("/resend-verification", limitRoute, verifyCode); -router.post("/choice", auth, handleUserChoice); +// TODO: fix verifycode is not defined +// router.post("/resend-verification", limitRoute, verifyCode); + +// TODO: fix the issue in handleUserChoice controller +// router.post("/choice", auth, handleUserChoice); module.exports = router; diff --git a/src/services/emailsenderProducer.js b/src/services/emailsenderProducer.js index eefa221..8739c8c 100644 --- a/src/services/emailsenderProducer.js +++ b/src/services/emailsenderProducer.js @@ -1,6 +1,6 @@ -const { promisify } = require("utile"); +const { promisify } = require("util"); const redisClient = require("./redisServer"); -const rpushAsync = promisify(redisClient.rpush).bind(redisClient); +const rpushAsync = promisify(redisClient.rPush).bind(redisClient); // function to add a job to email queue async function queueEmailSending(mailOptions) { diff --git a/src/services/redisServer.js b/src/services/redisServer.js index c896aa0..e6ce751 100644 --- a/src/services/redisServer.js +++ b/src/services/redisServer.js @@ -1,18 +1,13 @@ const { createClient } = require("redis"); -// const wildcards = require("disposable-email-domains/wildcard.json"); const client = createClient({ socket: { host: process.env.REDIS_HOST || "127.0.0.1", - port: process.env.REDIS_PORT || 6379, + port: process.env.REDIS_PORT || 8800, }, - password: process.env.REDIS_PASSWORD, -}); - -// when error -client.on("error", () => { - console.log(`Redis client Error:`, error); + // password: process.env.REDIS_PASSWORD, }); +// const client = createClient(); client.on("connect", () => { console.log(`Redis client connected....`); diff --git a/src/services/totpAuth.js b/src/services/totpAuth.js index 4485ca1..ac87474 100644 --- a/src/services/totpAuth.js +++ b/src/services/totpAuth.js @@ -95,7 +95,7 @@ qrcode.toDataURL(otpauthUrl, { width: 300 }, (err, url) => { function verifyOTP() { const secret = "${secret.base32}"; const userProvidedCode = document.getElementById("otpInput").value; - + // Send request to server for OTP verification (replace this with actual server request) fetch('/verify', { method: 'POST', diff --git a/src/utils/cookieToken.js b/src/utils/cookieToken.js index 2851061..73eedea 100644 --- a/src/utils/cookieToken.js +++ b/src/utils/cookieToken.js @@ -21,7 +21,8 @@ const cookieToken = async (user, res) => { httpOnly: true, }; - re.status(200) + res + .status(200) .cookie("token", token, options) .json({ success: true, diff --git a/src/utils/isContactsValid.js b/src/utils/isContactsValid.js index 3e14399..b8a91c5 100644 --- a/src/utils/isContactsValid.js +++ b/src/utils/isContactsValid.js @@ -1,10 +1,9 @@ const axios = require("axios"); -const phone_ver_key = process.env.PHONE_VER_API_KEY; -const email_ver_key = process.env.RAPID_API_KEY; +const { rapidApiKey, phoneVerApiKey } = require("./constants"); // Function to verify disposable and valid email const verifyEmail = async (email) => { - if (!email_ver_key) { + if (rapidApiKey === undefined) { throw new Error("Missing email verification API key."); } @@ -20,6 +19,7 @@ const verifyEmail = async (email) => { try { const request = await axios.request(options); + console.log(request.data); return request.data; } catch (error) { console.error("Error verifying email:", error); @@ -29,7 +29,7 @@ const verifyEmail = async (email) => { // Function to verify phone number const verifyPhone = async (phone) => { - if (!phone_ver_key) { + if (!phoneVerApiKey) { throw new Error("Missing phone verification API key."); }