devise_security_extension:安装命令不起作用

时间:2015-05-26 19:38:11

标签: ruby ruby-on-rails-4 devise

rails 4.2.1.rc4,设计3.5.1,设计uid 0.1.1,devise_security_extension 0.9.2

生成器完成"插入config / initializers / devise.rb"并安装了语言环境文件,但没有新的信息添加到devise.rb,也没有devise_security_extensions.rb文件。

有修复吗?或手动安装?

2 个答案:

答案 0 :(得分:0)

生成rails generate devise_security_extension:install后,它将在devise.rb文件中创建一些安全性输入 -

Devise.setup do |config|
  # ==> Security Extension
  # Configure security extension for devise

  # Should the password expire (e.g 3.months)
  # config.expire_password_after = 3.months

  # Need 1 char of A-Z, a-z and 0-9
  # config.password_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/

  # How often save old passwords in archive
  # config.password_archiving_count = 5

  # Deny old password (true, false, count)
  # config.deny_old_passwords = true

  # captcha integration for recover form
  # config.captcha_for_recover = true

  # captcha integration for sign up form
  # config.captcha_for_sign_up = true

  # captcha integration for sign in form
  # config.captcha_for_sign_in = true

  # captcha integration for unlock form
  # config.captcha_for_unlock = true

  # security_question integration for recover form
  # this automatically enables captchas (captcha_for_recover, as fallback)
  # config.security_question_for_recover = false

  # security_question integration for unlock form
  # this automatically enables captchas (captcha_for_unlock, as fallback)
  # config.security_question_for_unlock = false

  # security_question integration for confirmation form
  # this automatically enables captchas (captcha_for_confirmation, as fallback)
  # config.security_question_for_confirmation = false

  # ==> Configuration for :expirable
  # Time period for account expiry from last_activity_at
  # config.expire_after = 90.days
end

更多安全性更改,请参阅https://github.com/phatworx/devise_security_extension

答案 1 :(得分:0)

所以:install命令实际上正在工作并安装引擎。我将devise_security_extension.rb代码插入到devise.rb中并​​配置了我想要它的方式并且它正在工作。

我发现如果您修改了devise.rb文件,然后尝试安装devise_security_extension,则不会注入其代码。