require a non-empty key to decode a JWT by sjones608 · Pull Request #60 · firebase/php-jwt
In testing this library for use on a project, I was surprised when JWT::decode returned a successfully decoded payload even when an empty key was supplied. I mistakenly supplied an empty key b/c I accidentally referred to it in a config file by the wrong name.
I would think that an empty key should be an error. Otherwise, it would be possible to deploy an application using this library and have all tokens be successfully decoded, regardless of what key was used to encode them. As mentioned above, this could happen through accidental mishandling of configuration files.
I could be wrong about this and an empty key might be possible by design. If so, nevermind, and I'll just be more careful. ;-)
I've made the code changes to JWT::decode and added 2 new tests to verify that empty keys generate exceptions.