intridea/omniauth — pull request #688 by fwny (2013-06-23 03:03:34+00:00)
Title: Fix callback controllers not working when using a non-default MIME type.

This code makes "on_path?" comparisons in Strategy.rb MIME type agnostic. Please review carefully as I am inexperienced with RoR work and just needed a fix for something I was working on.

Basically, on_path? being MIME type sensitive becomes a problem if someone wants to use a non-default type in their callbacks. In my case I had the route /users/auth/:action/callback(.:format) leading to my omniauth callbacks controller.

I have special template and redirect behaviour for the .tpl format and I used /users/auth/facebook/callback.tpl as a callback which resulted in request.env["omniauth.auth"] not being populated because OmniAuth incorrectly determined I was not on a callback path.

I'm not sure if there is a better way to accomplish this check. Any form of simple pattern matching has the chance of unintended positive matches if people get creative with their routes.