-
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] Limiting the Number of upvotes/downvotes a particular user can do Fixed #942
Conversation
@@ -24,6 +25,9 @@ | |||
// Response time | |||
app.use(responseTime({ suffix: false })); | |||
|
|||
// cookie | |||
app.use(cookieParser()); |
Check failure
Code scanning / CodeQL
Missing CSRF middleware High
request handler
This cookie middleware is serving a
request handler
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.
@Hemu21 did u test this change?
return next(error); | ||
} | ||
|
||
res.cookie(getVoteCookieName('question', questionId), true, { maxAge: 20 * 365 * 24 * 60 * 60 * 1000 }); |
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.
what is the unit of this?
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.
I kept it to 20 years. why because no one can use a mobile for 20 years.
@Kajol-Kumari I had tested Everything works fine. can you please check and merge it. see this Untitled.video.-.Made.with.Clipchamp.mp4 |
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.
LGTM 👍
Issue that this pull request solves
Issue Link resolve #919
Closes: #919
Brief description of what is fixed or changed
As the Q&A section is open, users can do the upvote and downvotes any umber of times. Now tey can vote only once.
Types of changes
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply