Ver código fonte

Return early if JWT unsupplied

Andrew Swistak 5 anos atrás
pai
commit
5eaf84c455
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      lib/json_web_token.rb

+ 2 - 0
lib/json_web_token.rb

@@ -20,6 +20,8 @@ class JsonWebToken
   end
 
   def self.decode(token)
+    return if token.nil?
+
     JWT.decode(
       token,
       Rails.application.credentials.jwt_secret,