0

我正在使用客户端流程实现 facebook 身份验证。之后,我想使用 cookie 策略与后端的 Omniauth 框架集成。问题是,在登录 facebook 并尝试调用 Omniauth 回调后,在预检申请 ( OPTIONS) 上,我的全局选项路由无法识别,并且后端不返回任何 CORS 标头。

路线定义:

  match '*path', to: 'application#handle_options_request', constraints: {:method => 'OPTIONS'}

调用回调时,它永远不会传递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

所有其他OPTION基于请求的路由都很好,但不是上面的这个。有没有人已经面临这个问题?

====

Omniauth 路由

$ 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)
4

0 回答 0