Skip to content

Commands to change user password

Julius Kvedaras requested to merge docs-how-to-change-password-console into master

Adding some commands on how to change a password in the rails console. It's good to have when the admin user locks himself out of the instance and can not reset the password. There is another way to do this:

gitlab-rails console production
user = User.find_by(email: 'emil_id')
user.password = 'secret_pass' //at least 8 characters long
user.password_confirmation = 'secret_pass'
user.save!

But I like the solution that I am submitting better.

Merge request reports