Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all secrets of one auth client return the response but data is always empty #1335

Closed
russojrv-zz opened this issue Oct 15, 2021 · 1 comment · Fixed by #1336
Closed

Comments

@russojrv-zz
Copy link

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

  1. 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', ); },

@heggert
Copy link
Member

heggert commented Oct 20, 2021

Fixed with #1336

@heggert heggert linked a pull request Oct 20, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants