Closed Swarnendu0123 closed 2 weeks ago
Thank you for your work on this! As this PR currently doesn't pass all the tests and the PR queue we currently have, I'm going to close this one for now. I'm sorry that we couldn't get this in, but please feel free to update and reopen this PR with any changes or check out the other issues!
Fixes #3016
Changes:
As for the concern about setting the isNew flag to false, it's important to reset this flag after hashing each API key to prevent rehashing it unnecessarily in subsequent save operations. With the provided code, the isNew flag is set to false within the map function after hashing each API key. This ensures that each new API key is hashed only once, even if the save operation is called multiple times.
This implementation maintains the flow of the middleware and ensures that the next() function is called appropriately based on the completion or failure of the asynchronous operations.
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123