Tuesday, December 11, 2012

[Rails] omniauth routing error help

I'm trying to setup omniauth for my application. I'm able to get to twitter but i get a No route matches {:controller=>"sessions", :action=>"auth_callback"}
on the callback. When i run rake routes it shows that the route exists.
ROUTES FILE
  match'auth/:provider/callback' => 'sessions#auth_callback', :as => :auth_callback
  match 'logout', :to => 'sessions#destroy'

RAKE ROUTES OUTPUT
auth_callback /auth/:provider/callback(.:format) sessions#auth_callback logout /logout(.:format) sessions#destroy


Sessions auth_callback controller method
def auth_callback auth = request.env["omniauth.auth"] user = Moviegoer.find_by_provider_and_uid(auth["provider"], auth["uid"]) || Moviegoer.create_with_omniauth(auth) session[:user_id] = user.id redirect_to movies_path end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Ojmxa6NWAjMJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate