Skip to content

Commit

Permalink
fix: Correct variables used in errors in sign.js
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AtkinsSJ committed May 2, 2024
1 parent fa3b86f commit fa7c6be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/backend/src/routers/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit fa7c6be

Please sign in to comment.