I'm implementing a facebook authentication with client side flow.
After that, I'd like to integrate with the Omniauth framework on backend using the cookies strategy.
The problem is that after login on facebook and try to call the Omniauth callback, on the preflight requisition (OPTIONS
), my global option route is not recognized and the backend doesn't return any CORS headers.
Route definition:
match '*path', to: 'application#handle_options_request', constraints: {:method => 'OPTIONS'}
When calling the callback, it never passes on application#handle_options_request
:
[2014-09-02 18:02:25] INFO Rails : Started OPTIONS "/users/auth/facebook" for 127.0.0.1 at 2014-09-02 18:02:25 +0100
All the others OPTION
request based are routed fine but not this one above.
Has anyone already faced this problem?
====
Omniauth routes
$ bundle exec rake routes
user_omniauth_authorize GET|POST /users/auth/:provider(.:format) authentications#passthru {:provider=>/facebook|google_oauth2|twitter/}
user_omniauth_callback GET|POST /users/auth/:action/callback(.:format) authentications#(?-mix:facebook|google_oauth2|twitter)