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

Default to Use starkBank.user when verifying signature. #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inglkruiz
Copy link

Hi, I'm not entirely sure if this is the correct fix but while using the SDK I had an issue when consuming webhook events.

It does not seem correct to set it to null because the user is needed for getting the public key.

getPublicKey = async function (user = starkBank.user) 

Consider the following please

JavaScript Default Parameters with null or empty Argument
If we do not provide any value for the function parameter then the default value is used, but what if someone provides null or an empty string as value. In that case null and empty value is considered valid and default parameter value is not used.

Hi, I'm not entirely sure if this is the correct fix but while using the SDK I had an issue when consuming webhook events.

It does not seem correct to set it to `null` because the user is needed for getting the public key.

```ts
getPublicKey = async function (user = starkBank.user) 
```

Consider the following please

> JavaScript Default Parameters with null or empty Argument
If we do not provide any value for the function parameter then the default value is used, but what if someone provides null or an empty string as value. In that case null and empty value is considered valid and default parameter value is not used.
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.

1 participant