-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Backend] Problem in delete contact us api Fixed #933
Conversation
router.post('/contactus', validation(contactValidationSchema), postContact); | ||
router.delete("/deleteContactUs", deleteContactUs); | ||
router.get('/getcontactus', getContact); | ||
router.post('/',authMiddleware, validation(contactValidationSchema), postContact); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
router.delete("/deleteContactUs", deleteContactUs); | ||
router.get('/getcontactus', getContact); | ||
router.post('/',authMiddleware, validation(contactValidationSchema), postContact); | ||
router.delete("/deleteContactUs",authMiddleware, deleteContactUs); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
authorization
router.delete("/deleteContactUs", deleteContactUs); | ||
router.get('/getcontactus', getContact); | ||
router.post('/',authMiddleware, validation(contactValidationSchema), postContact); | ||
router.delete("/deleteContactUs",authMiddleware, deleteContactUs); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
a database access
@Kajol-Kumari can you please check and merge it. |
errStack: 'Both IDs are required to delete a contact', | ||
}); | ||
return next(error); | ||
if (!payload.isSuperAdmin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ques] why are we doing this check? shouldn't auth middleware take care of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kajol-Kumari It is the code flow. I followed based on existing code bases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kajol-Kumari in every file they is this type of check. So I thought Auth Middleware doesn't handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u provide me the reference of where do u see it, it shouldn't be required ideally, try removing and then test the delete functionality, it should not work without authorization key of an admin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kajol-Kumari can you please check this here i saw like this Here
Issue that this pull request solves
Issue Link resolve #932
Closes: #932
Brief description of what is fixed or changed
Delete contact us is not working properly. and contact us routes fixing. and adding validation. fixed. now delete works properly.
Types of changes
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply