Describe the bug
When you try to get all secrets of one auth client, it never returns items. The problem is that one await is missing in the code.
Expected behavior
Get all secrets of an auth client.
To Reproduce
- Call to the /:authclientId/secrets endpoint in the secret-service
Solution
Add the await to the corresponding method.
services/secret-service/src/route/auth-clients/index.js (Add the await)
const secrets = await findByAuthClient( req.user.sub, authClient._id, );
services/secret-service/src/dao/secret.js (Remove await/async and return the Promise)
findByAuthClient( id, authClientId, ) { return Secret.full.find({ 'value.authClientId': authClientId, 'owners.id': id, }, 'name type value.authClientId value.scope value.expires value.externalId owners currentError', ); },
Describe the bug
When you try to get all secrets of one auth client, it never returns items. The problem is that one await is missing in the code.
Expected behavior
Get all secrets of an auth client.
To Reproduce
Solution
Add the await to the corresponding method.
services/secret-service/src/route/auth-clients/index.js (Add the await)
const secrets = await findByAuthClient( req.user.sub, authClient._id, );services/secret-service/src/dao/secret.js (Remove await/async and return the Promise)
findByAuthClient( id, authClientId, ) { return Secret.full.find({ 'value.authClientId': authClientId, 'owners.id': id, }, 'name type value.authClientId value.scope value.expires value.externalId owners currentError', ); },