fix: await the result returned by resourceIndicators.useGrantedResource function, in resolve_resource.js #1173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, thank all the contributors for your effort in building this awesome project, which helps me a lot! During my usage, I found something that maybe a minor bug.
The
features.resourceIndicators.useGrantedResource
function defined in the config can be async function. In fact, the default value for that is indeed an async function:node-oidc-provider/lib/helpers/defaults.js
Lines 201 to 206 in 2ba8395
However, when the function is called in
resolver_resource.js
, which is used to resolve the resource for a auth or token request, the value returned byuseGrantedResource
is not awaited:node-oidc-provider/lib/helpers/resolve_resource.js
Line 14 in 2ba8395
In my opinion, this is a bug, which makes the
useGrantedResource
configration have no effect, since !! aPromise
will always equals totrue
.Thank you for your review!