prevent nil token

This commit is contained in:
Bilal
2020-07-29 18:45:11 +02:00
parent 76934cefb5
commit 83aa0a7aab
2 changed files with 4 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ class Api::UsersController < Api::ApiController
end
def verify_custom_token
if token != ENV['CUSTOM_API_TOKEN']
if token.nil? || token.empty? || token != ENV['CUSTOM_API_TOKEN']
unauthorized_entity(:user)
end
end