Closed lottamus closed 1 year ago
Currently the middleware is only checking truthiness on the response from the resolver. So if you return a string or Error, it will pass the rule instead of failing.
string
Error
https://github.com/omar-dulaimi/trpc-shield/blob/d8bd1f3151dd08486ffcfbadac1605c39c5af807/src/rules.ts#L26-L29
This PR handles throwing the Error returned from the resolver.
LGTM!
Thank you for the PR. Released in https://github.com/omar-dulaimi/trpc-shield/releases/tag/0.4.1
Currently the middleware is only checking truthiness on the response from the resolver. So if you return a
string
orError
, it will pass the rule instead of failing.https://github.com/omar-dulaimi/trpc-shield/blob/d8bd1f3151dd08486ffcfbadac1605c39c5af807/src/rules.ts#L26-L29
This PR handles throwing the Error returned from the resolver.