Commit 5e4da48a authored by Sean Arnold's avatar Sean Arnold Committed by Ash McKenzie

Use a random password when generating users

parent 7eb1c3bc
......@@ -22,7 +22,7 @@ class Gitlab::Seeder::Users
private
def create_mass_users!
encrypted_password = Devise::Encryptor.digest(User, '12345678')
encrypted_password = Devise::Encryptor.digest(User, random_password)
Gitlab::Seeder.with_mass_insert(MASS_USERS_COUNT, User) do
ActiveRecord::Base.connection.execute <<~SQL
......@@ -49,6 +49,10 @@ class Gitlab::Seeder::Users
FROM users WHERE NOT admin
SQL
end
puts '==========================================================='
puts "INFO: Password for newly created users is: #{random_password}"
puts '==========================================================='
end
def create_random_users!
......@@ -59,7 +63,7 @@ class Gitlab::Seeder::Users
name: FFaker::Name.name,
email: FFaker::Internet.email,
confirmed_at: DateTime.now,
password: '12345678'
password: random_password
)
print '.'
......@@ -68,6 +72,10 @@ class Gitlab::Seeder::Users
end
end
end
def random_password
@random_password ||= SecureRandom.hex.slice(0,16)
end
end
Gitlab::Seeder.quiet do
......
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