Przeglądaj źródła

Return early if JWT unsupplied

Andrew Swistak 5 lat temu
rodzic
commit
5eaf84c455
1 zmienionych plików z 2 dodań i 0 usunięć
  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,