diff --git a/packages/backend/src/routers/open_item.js b/packages/backend/src/routers/open_item.js index b4d0599d..cdd94f86 100644 --- a/packages/backend/src/routers/open_item.js +++ b/packages/backend/src/routers/open_item.js @@ -45,7 +45,7 @@ module.exports = eggspress('/open_item', { const subject = req.values.subject; const actor = Context.get('actor'); - if ( ! actor.type instanceof UserActorType ) { + if ( ! (actor.type instanceof UserActorType) ) { throw APIError.create('forbidden'); } diff --git a/packages/backend/src/routers/save_account.js b/packages/backend/src/routers/save_account.js index 67876fbf..de58daf3 100644 --- a/packages/backend/src/routers/save_account.js +++ b/packages/backend/src/routers/save_account.js @@ -19,7 +19,7 @@ "use strict" const express = require('express'); const router = new express.Router(); -const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user} = require('../helpers'); +const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user, get_user } = require('../helpers'); const auth = require('../middleware/auth.js'); const config = require('../config'); const { Context } = require('../util/context'); diff --git a/packages/backend/src/routers/sign.js b/packages/backend/src/routers/sign.js index 9a8d6aa5..2e6330ca 100644 --- a/packages/backend/src/routers/sign.js +++ b/packages/backend/src/routers/sign.js @@ -34,7 +34,7 @@ module.exports = eggspress('/sign', { allowedMethods: ['POST'], }, async (req, res, next)=>{ const actor = Context.get('actor'); - if ( ! actor.type instanceof UserActorType ) { + if ( ! (actor.type instanceof UserActorType) ) { throw APIError.create('forbidden'); }