Use early return in lfs_token_check
This commit is contained in:
parent
dba227da88
commit
242e77e070
|
@ -113,18 +113,18 @@ module Gitlab
|
||||||
User.by_login(login)
|
User.by_login(login)
|
||||||
end
|
end
|
||||||
|
|
||||||
if actor
|
return unless actor
|
||||||
token_handler = Gitlab::LfsToken.new(actor)
|
|
||||||
|
|
||||||
authentication_abilities =
|
token_handler = Gitlab::LfsToken.new(actor)
|
||||||
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)
|
authentication_abilities =
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
def build_access_token_check(login, password)
|
def build_access_token_check(login, password)
|
||||||
|
|
Loading…
Reference in New Issue