go-macaroon / js-macaroon

Javascript implementation of macaroons
BSD 3-Clause "New" or "Revised" License
41 stars 22 forks source link

Add null check to decrypt response #37

Closed nickrobison-usds closed 5 years ago

nickrobison-usds commented 5 years ago

When decryption fails due to an incorrect root key, the response from the decrypt function is null instead of false, this adds a check to ensure that the error is correctly thrown, otherwise the error comes from the downstream method and is less clear.

hatched commented 5 years ago

Thanks for the pull request @nickrobison-usds 👍 !

Could you please add an additional test case for this? The best place for it would be in https://github.com/go-macaroon/js-macaroon/blob/master/test/verify.js

You can run the tests locally with npm t.

hatched commented 5 years ago

Thanks again @nickrobison-usds