Use early return in lfs_token_check

This commit is contained in:
Kamil Trzcinski 2016-09-20 09:41:21 +02:00
parent dba227da88
commit 242e77e070
1 changed files with 10 additions and 10 deletions

View File

@ -113,18 +113,18 @@ module Gitlab
User.by_login(login)
end
if actor
token_handler = Gitlab::LfsToken.new(actor)
return unless actor
authentication_abilities =
if token_handler.user?
full_authentication_abilities
else
read_authentication_abilities
end
token_handler = Gitlab::LfsToken.new(actor)
Result.new(actor, nil, token_handler.type, authentication_abilities) if Devise.secure_compare(token_handler.value, password)
end
authentication_abilities =
if token_handler.user?
full_authentication_abilities
else
read_authentication_abilities
end
Result.new(actor, nil, token_handler.type, authentication_abilities) if Devise.secure_compare(token_handler.value, password)
end
def build_access_token_check(login, password)