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

fix: Policies always deny #28

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sushmab84
Copy link

@sushmab84 sushmab84 commented Mar 14, 2024

When there are no errors, the combinedErrors array will consist of empty arrays: [ [], [], ..., [] ]. Consequently, the condition combinedErrors.length > 0 will always evaluate to true, as the length of combinedErrors equals the number of inner arrays, thereby triggering the denial of the request.

In this pull request, I'm utilizing the errors.flat() method, which returns a new array with its sub-array elements concatenated into it. This ensures that when no error is present, combinedErrors will be equal to an empty array [], while when errors are present, it will contain strings like "error 1", "error 2", ..., "error n".

This fix also resolves #9.

@mdnfiras
Copy link
Contributor

This PR also solves the same issue, but slightly different solution: #10 (open for 2 years...)
errors.flat() feels cleaner though, I hope they merge this one.

Copy link

@merusso merusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

To maintainers: Can we please get this merged? This error bit us when trying to use the SDK.

@merusso
Copy link

merusso commented Sep 6, 2024

@LukasGentele or @FabianKramm, could you please take a look? This fixes a pretty old bug in the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Policies always deny when using the SDK
4 participants