Skip to content

Commit

Permalink
fix(resourceIndicators): await the result of useGrantedResource (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starrah authored Jan 4, 2022
1 parent 2ba8395 commit 64a8028
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/helpers/resolve_resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = async (ctx, model, config, scopes = model.scopes) => {
case !model.resource:
case Array.isArray(model.resource) && model.resource.length === 0:
break;
case model.resource && !!config.resourceIndicators.useGrantedResource(ctx, model):
case model.resource && !!(await config.resourceIndicators.useGrantedResource(ctx, model)):
case !ctx.oidc.params.resource && (!config.userinfo.enabled || !scopes.has('openid')):
resource = model.resource;
break;
Expand Down
2 changes: 1 addition & 1 deletion test/resource_indicators/resource_indicators.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ merge(config, {
},
resourceIndicators: {
enabled: true,
useGrantedResource(ctx) {
async useGrantedResource(ctx) {
return ctx.oidc.body && ctx.oidc.body.usegranted;
},
getResourceServerInfo(ctx, resource) {
Expand Down

0 comments on commit 64a8028

Please sign in to comment.