The root cause is the use of Base.encode64 in guardian.gen.secret. Switching that to Base.url_encode64 would solve this issue but probably break something else...
Additional backstory and discussion in this Elixir Forum thread; thanks to the original poster for bringing this up.
Steps to Reproduce
mix guardian.gen.secret
secret_key: %{"k" => System.get_env("THAT_SECRET_KEY"), "kty" => "oct"}
Expected Result
It should work. :)
Actual Result
Sometimes, the generated secret has a
+
in it which isn't allowed according to the spec and crashes the URL-safe base64 decoder.The root cause is the use of
Base.encode64
inguardian.gen.secret
. Switching that toBase.url_encode64
would solve this issue but probably break something else...Additional backstory and discussion in this Elixir Forum thread; thanks to the original poster for bringing this up.