我正在使用gem omniauth
,当我将代码推送到Github时,由于使用gem ,它向我显示了安全警告。
CVE-2015-9284
high severity
Vulnerable versions: <= 1.9.0
Patched version: No fix
The request phase of the OmniAuth Ruby gem is vulnerable to Cross-Site Request Forgery when used as part of the Ruby on Rails framework, allowing accounts to be connected without user intent, user interaction, or feedback to the user. This permits a secondary account to be able to sign into the web application as the primary account.
Run Code Online (Sandbox Code Playgroud)
但是,看来我使用的是最新版本
有没有可能的解决方法,还是我现在应该跳过此步骤?
谁能帮我区分{% %}
和{%- -%}
. 这些语法之间有什么区别。在我的所有用法中,我可以使用任何主题
跑步时rake --tasks
,它向我展示
rake dev:cache # Toggle development mode caching on/off
Run Code Online (Sandbox Code Playgroud)
我知道我们有一些片段的开发视图缓存。Rails 还有其他缓存吗?例如:数据库查询
另外,如果在生产模式下我们也有这个缓存,它有用吗?
我正在尝试在我使用设计进行用户管理的项目中添加自定义密码验证。我成功创建用户,或者手动更改用户密码。但是,如果我退出控制台并再次打开它,我的有效用户(最后一步)将变得无效。
我正在使用 devise 4.6.2 和rails 5.2.0
这是我的用户模型
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
validates :password,
format: { with: /\A(?=.*\d)(?=.*[A-Z])(?=.*\W)[^ ]{7,}\z/,
message: 'Password should have more than 7 characters including 1 uppercase letter, 1 number, 1 special character'
}
end
Run Code Online (Sandbox Code Playgroud)
当我在控制台中尝试时
u = User.new(email: 'test@test.com', password: 'Abc123!', password_confirmation: 'Abc123!')
u.valid? # TRUE
u.save
Run Code Online (Sandbox Code Playgroud)
然后
u = User.last # return exact above user
u.valid? # FALSE
u.errors.full_messages # Password Password should have more than 7 characters including …
Run Code Online (Sandbox Code Playgroud)