提交 66bc758e 编写于 作者: R Robert Speicher

Update User model for two-factor auth

上级 6fa29429
......@@ -73,8 +73,11 @@ class User < ActiveRecord::Base
default_value_for :hide_no_password, false
default_value_for :theme_id, gitlab_config.default_theme
devise :lockable, :async,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable
devise :two_factor_authenticatable,
otp_secret_encryption_key: File.read(Rails.root.join('.secret')).chomp
devise :two_factor_backupable
devise :lockable, :async, :recoverable, :rememberable, :trackable,
:validatable, :omniauthable, :confirmable, :registerable
attr_accessor :force_random_password
......@@ -663,4 +666,9 @@ class User < ActiveRecord::Base
true
end
# Used to populate the hidden form field during Two-factor authentication
def login
username || email
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册