OmniAuth doesn't work with Route Globbing in Rails3

后端 未结 2 604
孤独总比滥情好
孤独总比滥情好 2020-12-29 00:49

I am trying to follow the Railscast 241 Simple OmniAuth and it works fine unless I have Route Globbing at the end of /config/routes.rb:

match \         


        
2条回答
  •  灰色年华
    2020-12-29 01:19

    Slightly modified suggestion of Brandon Tilley:

    # config/routes.rb
    match '/auth/:provider/callback' => 'sessions#create'
    match 'auth/*rest' => 'application#omniauth'
    match '*uri' => 'posts#index'
    
    # app/controllers/application_controller.rb
    def omniauth
      render text: 'Authentication', status: 404
    end
    

提交回复
热议问题