Skip to content

Commit 3267e93

Browse files
ilmartyrkDiverVM
andauthored
remove extra check when delete idea (#464)
Co-authored-by: Viktar Maslouski <[email protected]>
1 parent 45f1def commit 3267e93

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

routes/api/ideation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,6 @@ module.exports = function (app) {
907907
const ideaId = req.params.ideaId;
908908
const ideationId = req.params.ideationId;
909909
const topicId = req.params.topicId;
910-
const sessToken = createHash('sha256').update(req.cookies[config.session.name]).digest('base64');
911910
const idea = await Idea.findOne({
912911
where: {
913912
id: ideaId
@@ -934,7 +933,7 @@ module.exports = function (app) {
934933
res.forbidden();
935934
}
936935

937-
if ((!ideation.allowAnonymous && idea.authorId !== req.user.id) || (ideation.allowAnonymous && idea.sessionId !== sessToken)) {
936+
if (idea.authorId !== req.user.id) {
938937
return res.forbidden();
939938
}
940939

0 commit comments

Comments
 (0)