Commit 84d6dcbe authored by Etienne Baqué's avatar Etienne Baqué Committed by Stan Hu

Updated call to find deploy token

parent a6b60fee
...@@ -202,8 +202,7 @@ module Gitlab ...@@ -202,8 +202,7 @@ module Gitlab
def deploy_token_check(login, password) def deploy_token_check(login, password)
return unless password.present? return unless password.present?
token = token = DeployToken.active.find_by_token(password)
DeployToken.active.find_by(token: password)
return unless token && login return unless token && login
return if login != token.username return if login != token.username
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
FactoryBot.define do FactoryBot.define do
factory :deploy_token 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}" } sequence(:name) { |n| "PDT #{n}" }
read_repository true read_repository true
read_registry true read_registry true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment