0

I have create a rails engine that uses omniauth. In that engine, regardless of running on ruby 1.8.7 or 1.9.2, when I test it using the dummy application, everything works just as fine (using Rails 3.1.3).

I can login using any of the providers by going to /auth/:provider, such as /auth/google.

When I include (as a gem) that engine and mount it to '/' in the host application, the login process works when I use ruby 1.8.7, but gives me a No route matches [GET] "/auth/google when I use ruby 1.9.2.

So, to wrap it up, I get a No route matches [GET] "/auth/google when Omniauth is inside an engine and that I use Ruby 1.9.2.

I tried the devise solution where you create a pass thru action that generates a 404 error, but if I do that, I then get stuck on that 404 error...

Any ideas?

Dominic Goulet
  • 7,983
  • 7
  • 28
  • 56
  • This issue is relly bound to the ruby version. Whenever I switch back to 1.8.7 using rvm, it works, and then switch to 1.9.2, and I get the error. What is really weird is that this always works in the dummy application where the gem is also mounted on `'/'`. – Dominic Goulet Nov 29 '11 at 14:40
  • I also having this problem. Did you resolve it? – Yeggeps Mar 23 '12 at 18:36

1 Answers1

1

write the following code in your Engine

middleware.use OmniAuth::Builder do
  provider :provider, 'APP_ID', 'APP_SECRET' 
end

and you will have login url under /mount_point/auth/:provider

Dmitry Lihachev
  • 504
  • 6
  • 20