From 01f026712e74a880f7126ad221ef88e8e267dc91 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Mon, 30 May 2016 22:56:49 -0700 Subject: [PATCH] Fixed authentication issues --- server/api/authentication.js | 2 +- server/api/documents.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/api/authentication.js b/server/api/authentication.js index c786c8259..ceb0b5105 100644 --- a/server/api/authentication.js +++ b/server/api/authentication.js @@ -30,7 +30,7 @@ export default function auth({ require = true } = {}) { throw httpErrors.Unauthorized('Authentication required'); } - if (token && require) { + if (token) { // Get user without verifying payload signature let payload; try { diff --git a/server/api/documents.js b/server/api/documents.js index ed85a867b..9a02389b5 100644 --- a/server/api/documents.js +++ b/server/api/documents.js @@ -25,7 +25,7 @@ router.post('documents.info', auth({ require: false }), async (ctx) => { const team = await ctx.state.user.getTeam(); if (document.teamId !== team.id) { - if (!document) throw httpErrors.NotFound(); + throw httpErrors.NotFound(); } ctx.body = {