I want to build RailsAPI with facebook login, so I chose devise_token_auth
. I followed the instruction and run rails g devise_token_auth:install User auth
, my routes look like
routes.rb
Rails.application.routes.draw do
mount_devise_token_auth_for 'User', at: 'auth'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
So it is the stuff that comes from generator.
I registered my app at facebook for developers, store the facebook-key and facebook-secret in env file. When I hit the first time localhost:3000/auth/facebook
it redirectem me to facebook auth popup, I clicked the button and then the error comes.
Should I override the controller from devise with my own? How to do that? Or there are any other solutions?
I would like to mention that is my first time building API with rails.