我安装了devise token auth gem.https://github.com/lynndylanhurley/devise_token_auth#model-concerns
我设法获得路线和所有.但不幸的是,注册已停止工作.
当我尝试注册时,它会显示这样的错误.
NoMethodError in Devise::RegistrationsController#create
undefined method `provider' for #<User:0x007f49fd5da2e8>
Extracted source (around line #433):
else
match = match_attribute_method?(method.to_s)
match ? attribute_missing(match, *args, &block) : super
end
end
Run Code Online (Sandbox Code Playgroud)
这是我的路线
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
devise_for :users
namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth'
end
end
Run Code Online (Sandbox Code Playgroud)
根据文档,注册需要电子邮件,密码和password_confirmation.我不是我想念的.
这是"用户"的架构
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", …Run Code Online (Sandbox Code Playgroud)