Closed
Description
I tried to verify the issuer on a JWT that I was decoding today, and I found this line (and others like it) very ugly.
if options[:verify_iss] && options['iss']
This means that my code to decode the JWT looked like this:
JWT.decode(token, public_key, true, :verify_iss => true, 'iss' => 'my issuer')
In my opinion, the consumer of this API should be be able to do one of the following:
- Always use symbols as keys in the options hash.
- Always use strings as keys in the options hash.
- Be able to either use symbols or keys in the options in hash and have our library deal with it under the hood.
Thoughts?