Kra*_*thi 1 ruby-on-rails devise-confirmable ruby-on-rails-4.2
我正在为我的 Rails 应用程序使用 devise_token_auth gem。我想在用户注册完成后登录应用程序。如何跳过确认。
我试过了,config.reconfirmable = false但没有运气
任何人都可以建议我或帮助我如何实现这一目标?我尝试了提供的解决方案
为什么即使设置了allow_unconfirmed_access_for,Devise 也不允许未经确认的用户登录? 但仍然以
{"success":false,"errors":["A confirmation email was sent to your account at test123@gmail.com. You must follow the instructions in the email before your account can be activated"]}
Run Code Online (Sandbox Code Playgroud)
添加以下回调模型定义:
before_save -> { skip_confirmation! }
Run Code Online (Sandbox Code Playgroud)
并:confirmable从包含的设计模块中删除:
devise :database_authenticatable, :recoverable,
:trackable, :validatable, :registerable,
:omniauthable # there is no :confirmable here
Run Code Online (Sandbox Code Playgroud)