No route match [GET] "/ auth / facebook"

I get this error when I use omniauth, design with rails 3.1.3. I installed gem omniauth and omniauth facebook.

Configure route.rb as match '/auth/:provider/callback',to: 'authentications#create' asper guide https://github.com/intridea/omniauth

Whenever I look at the URL http: // localhost: 3003 / auth / facebook / , I find a routing error

 **No route matches [GET] "/auth/facebook"** 

Help with this. I have a related entry in stackoverflow and nobody seems to work

+6
source share
5 answers

I had the same issue when using Rails 3.2, OmniAuth 1.0.2 and Devise 2.0.

The problem seems to be related to "path_prefix". But with manual reconfiguration, everything works.

Try this in your initializer:

 Rails.application.config.middleware.use OmniAuth::Builder do configure do |config| config.path_prefix = '/auth' end ... end 
+8
source

I had the same problem and it turned out that it was caused by: omniauthable devise module. You will need to comment on the module, for example:

 #app/model/user.rb def User ... devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable#, :omniauthable ... end 

Sorry for the late reply.

+3
source

After a few hours, trying to fix this problem, I realized that I was config/initializers/omniauth.rb in the .gitignore file (shame on me).

so remove omniauth.rb from the .gitignore list if you haven't already

+1
source

This is most likely because you configured devise.rb to use scoped_views. Develop a default behavior is the coverage of the URL of your model. The best way around this is to use your own controllers, inheriting from Devise, and tell you which controllers and URLs to use. See the “Develop Wiki Pages” for a more detailed explanation of how to achieve this behavior.

0
source

This problem arose because of a conflict with the owner, we need to make sure that we change facebook "Website using Facebook Login" → website URL: "" in accordance with production and local development. enter image description here

0
source

Source: https://habr.com/ru/post/904621/


All Articles