diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-04-27 23:37:07 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-05-04 23:09:47 +0200 |
commit | e4c64855e8531a9375de1d64a95f2e593b80c2bd (patch) | |
tree | c69b39320f2b373bd4a851c26a2d3d9cb8d41af8 | |
parent | 950ab1e8470011bda4a2c481fc73e12df391dddf (diff) | |
download | gitlab-ce-e4c64855e8531a9375de1d64a95f2e593b80c2bd.tar.gz |
Don't read otp_secret_encryption_key from hardcoded path in models/user
Variable `Gitlab::Application.config.secret_key_base` is set in
config/initializers/secret_token.rb. It's very bad practice to use
hard-coded paths inside an application and really unnecessary in this
case.
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index ab48f8f1960..a468b6ea075 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -85,7 +85,7 @@ class User < ActiveRecord::Base default_value_for :theme_id, gitlab_config.default_theme devise :two_factor_authenticatable, - otp_secret_encryption_key: File.read(Rails.root.join('.secret')).chomp + otp_secret_encryption_key: Gitlab::Application.config.secret_key_base alias_attribute :two_factor_enabled, :otp_required_for_login devise :two_factor_backupable, otp_number_of_backup_codes: 10 |