Selaa lähdekoodia

Return early if JWT unsupplied

Andrew Swistak 5 vuotta sitten
vanhempi
commit
5eaf84c455
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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,