Browse Source

Return early if JWT unsupplied

Andrew Swistak 5 years ago
parent
commit
5eaf84c455
1 changed files with 2 additions and 0 deletions
  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,