Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No route found for omniauth developer strategy

I've just updated Omniauth from 0.2.6 to 1.1.1 in order to use the developer strategy. I've made my login link point to /auth/developer if the environment is development and /auth/facebook if production.

The Facebook strategy still works. When using the developer strategy, the link goes to the built-in Omniauth sign in page but returns a 404 when clicking sign in. This model does not use Devise.

Routes file

get "/auth/:provider/callback" => "sessions#create"
.
.
.
get '*a', :to => 'errors#routing'

Omniauth initializer

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, [etc.]
  provider :developer if Rails.env.development?
end

Log

Started GET "/auth/developer" for 127.0.0.1 at 2012-12-19 16:23:04 +0200
Started POST "/auth/developer/callback" for 127.0.0.1 at 2012-12-19 16:23:10 +0200
ActionController::RoutingError (No route matches "/auth/developer/callback")
like image 932
Simpleton Avatar asked Mar 10 '26 23:03

Simpleton


1 Answers

Ran into this today in a new rails 4 application, I'm currently using this route as a workaround:

match '/auth/:provider/callback', to: "sessions#create", via: [:get, :post]
like image 64
Tapio Saarinen Avatar answered Mar 13 '26 16:03

Tapio Saarinen