From fa7c6bee9699527028be0ae9759155bc67c52324 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 May 2024 17:39:01 +0100 Subject: [PATCH] fix: Correct variables used in errors in sign.js I couldn't figure out how to get a name for the no_suitable_app error unfortunately, so that's just commented out. /puter/packages/backend/src/routers/sign.js 65:74 error 'subject' is not defined no-undef 114:59 error 'subject' is not defined no-undef --- packages/backend/src/routers/sign.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/routers/sign.js b/packages/backend/src/routers/sign.js index 2e6330ca..df91c9bf 100644 --- a/packages/backend/src/routers/sign.js +++ b/packages/backend/src/routers/sign.js @@ -62,7 +62,8 @@ module.exports = eggspress('/sign', { app = await get_app({ uid: req.body.app_uid }); if ( ! app ) { - throw APIError.create('no_suitable_app', null, { entry_name: subject.entry.name }); + // FIXME: subject.entry.name isn't available here + throw APIError.create('no_suitable_app', null); //, { entry_name: subject.entry.name }); } // Generate user-app token const svc_auth = Context.get('services').get('auth'); @@ -111,7 +112,7 @@ module.exports = eggspress('/sign', { const svc_acl = Context.get('services').get('acl'); if ( ! await svc_acl.check(actor, node, 'see') ) { - throw await svc_acl.get_safe_acl_error(actor, subject, 'see'); + throw await svc_acl.get_safe_acl_error(actor, node, 'see'); } if ( app !== null ) {