Updated call to find deploy token

This commit is contained in:
Etienne Baqué 2019-07-19 13:44:30 -04:00 committed by Stan Hu
parent a6b60fee67
commit 84d6dcbe50
2 changed files with 3 additions and 3 deletions

View file

@ -202,8 +202,7 @@ module Gitlab
def deploy_token_check(login, password)
return unless password.present?
token =
DeployToken.active.find_by(token: password)
token = DeployToken.active.find_by_token(password)
return unless token && login
return if login != token.username

View file

@ -2,7 +2,8 @@
FactoryBot.define do
factory :deploy_token do
token { SecureRandom.hex(50) }
token nil
token_encrypted { Gitlab::CryptoHelper.aes256_gcm_encrypt( SecureRandom.hex(50) ) }
sequence(:name) { |n| "PDT #{n}" }
read_repository true
read_registry true