2012-08-28 99 views
4

我使用Omniauth gem让我的用户通过twitter注册。Omniauth登录而不刷新页面?

我想omniauth过程发生在幕后,所以我试图使链接/auth/twitter a remote: true链接。但是,当我这样做时,我会得到“回调阶段启动”,然后就是没有更多。

我认为这是因为omniauth宝石只能识别标准调用。我如何才能让它响应AJAX调用?

= link_to "Sign in with Twitter", twitter_signin_path, remote: true 
+0

检查我的答案在[这里](http://stackoverflow.com/questions/13149952/omniauth-authorization-call-with-ajax) – Viren

回答

1

这是不可能的,因为oauth授权流涉及重定向到提供商网站。

这一步发生在twitter.com上。它不可能完成JavaScript AJAX请求的流程。