tekul / jose-jwt

Haskell implementation of JOSE/JWT standards
BSD 3-Clause "New" or "Revised" License
35 stars 22 forks source link

Add `eitherDecodeClaims` #36

Open Lucsanszky opened 2 years ago

Lucsanszky commented 2 years ago

As discussed here: https://github.com/tekul/jose-jwt/issues/35 , this PR adds a utility function which preserves the error messages when decoding claims. @tekul, I was bold enough to add a String parameter to the BadClaims error. Let me know if this is acceptable or you would rather see me introduce a new error constructor.

Lucsanszky commented 2 years ago

Thanks for your review! I added the changes that you have requested, let me know if this looks any good to you.