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
This commit is contained in:
Sam Atkins 2024-05-02 17:39:01 +01:00
parent fa3b86fa7e
commit fa7c6bee96

View File

@ -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 ) {