JSON API Rails 6 与设计 - 注册问题

JSON API Rails 6 with Devise - SignUp Problems

当我尝试使用 Devise 的 sign_up 方法时,出现内部服务器错误,但是在创建用户后。

我的application.rb:

class ApplicationController < ActionController::Base
  protect_from_forgery with: :null_session, only: Proc.new { |c| c.request.format.json? }
  before_action :configure_permitted_parameters, if: :devise_controller?

  respond_to :json

  protected
  def configure_permitted_parameters
    devise_parameter_sanitizer.permit(:sign_up, keys: [ :username ])
  end
end

这里是输出,

有什么想法吗? 我正在用 Doorkeeper 对此进行补充,但请不要更改 Devise 的操作。我也没有在应用程序的任何地方单独使用 Warden。


这个问题似乎是您遇到的问题:

https://github.com/heartcombo/devise/issues/4603

他们建议清除浏览器的 cookies

this usually happens when you are upgrading a bunch of stuck including devise in one branch And than you get back to some other branch for something and you have this newer cookie in your browser. Simple solution is to clear cookies in browser.

其他答案提到升级设备版本