Skip to content

Commit 90b94bc

Browse files
authored
remove extra check when delete idea (#463)
1 parent c7c5f9a commit 90b94bc

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
@@ -917,7 +917,6 @@ module.exports = function (app) {
917917
const ideaId = req.params.ideaId;
918918
const ideationId = req.params.ideationId;
919919
const topicId = req.params.topicId;
920-
const sessToken = createHash('sha256').update(req.cookies[config.session.name]).digest('base64');
921920
const idea = await Idea.findOne({
922921
where: {
923922
id: ideaId
@@ -944,7 +943,7 @@ module.exports = function (app) {
944943
res.forbidden();
945944
}
946945

947-
if ((!ideation.allowAnonymous && idea.authorId !== req.user.id) || (ideation.allowAnonymous && idea.sessionId !== sessToken)) {
946+
if (idea.authorId !== req.user.id) {
948947
return res.forbidden();
949948
}
950949

0 commit comments

Comments
 (0)