Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Worked on email templete#8

Draft
Santan24 wants to merge 19 commits intomasterfrom
santan
Draft

Worked on email templete#8
Santan24 wants to merge 19 commits intomasterfrom
santan

Conversation

@Santan24
Copy link
Contributor

No description provided.

const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "santanrathore75209@gmail.com",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use any credentials used in config files or default.json. Can be used at multiple places and will have to update at one place only, if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

`,
};

try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should try-catch the whole function, and return the error. Anything could fail not just the mail.

app.js Outdated
require("dotenv").config();
require("./db/connectionDB");
require('./models/user')
require('./models/Survey')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be /survey. Filename case should match always.

@Santan24 Santan24 marked this pull request as draft June 16, 2021 16:54
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

res.send({ token });
try {
const { email, password } = req.body;
const user = await User.findOne({ email });

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
const updateProfile = async (req, res) => {
try {
const { _id } = req.body;
const userexist = await User.findOneAndUpdate({ _id }, { $set: req.body });

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
const updateProfile = async (req, res) => {
try {
const { _id } = req.body;
const userexist = await User.findOneAndUpdate({ _id }, { $set: req.body });

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.

router.post("/signup", signup);
router.post("/activate", verifyAccount);
router.post("/activate/:token", verifyAccount);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
a database access
, but is not rate-limited.
This route handler performs
a database access
, but is not rate-limited.
router.post("/activate/:token", verifyAccount);
router.post("/resetlink", resetlink);
router.post("/changepassword", changepassword);
router.post("/changepassword/:token", changepassword);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
a database access
, but is not rate-limited.
router.post("/changepassword", changepassword);
router.post("/changepassword/:token", changepassword);
router.post("/login", login);
router.put("/updateprofile", updateProfile);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.

router.post("/createsurvey", createSurvey);

router.post("/createsurvey", protect, createSurvey);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
This route handler performs
a database access
, but is not rate-limited.
router.post("/createsurvey", createSurvey);

router.post("/createsurvey", protect, createSurvey);
router.put("/response/yes/:id", responseYes);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.

router.post("/createsurvey", protect, createSurvey);
router.put("/response/yes/:id", responseYes);
router.put("/response/no/:id", responseNo);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
router.post("/createsurvey", protect, createSurvey);
router.put("/response/yes/:id", responseYes);
router.put("/response/no/:id", responseNo);
router.get("/getSurvey", getSurvey);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a database access
, but is not rate-limited.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants