使用 Authlogic 的 Facebooker 在授权后不会重定向到仪表板

发布于 2024-09-12 22:46:56 字数 606 浏览 6 评论 0原文

除了一件事之外,我使用 Authlogic(使用 authlogic_facebook_connect 插件)实现 Facebooker 时,一切似乎都运行良好。

在应用程序初始授权后(通过单击 Facebook 弹出窗口上的“确定”),我仍然保留在登录页面上。没有重定向。但是,一旦我刷新登录页面,然后再次单击 Facebook 按钮,就没有弹出窗口,因为它已经获得 Facebook 授权,而是自动重定向到 /user_session (通过 Facebook 会话进行身份验证)并立即将我带到仪表板页面正如预期的那样。

附加信息:

知道为什么在授权 Facebook 后第一次点击时它不会重定向吗?授权后 URL 设置为 http:///user_session/,并且 authlogic 的路由设置正确。

我尝试过 Prototype 和 jQuery,两者都给出相同的结果。

如果您尝试使用 Facebook 进行身份验证,您会在本教程网站上看到相同的问题。该网站不是我的,因此请自行承担风险: http://facebooker.pjkh.com

谢谢。

Everything seems to be working fine with my implementation of Facebooker with Authlogic (using the authlogic_facebook_connect plugin) except for one thing.

After the initial authorization of the application (by clicking OK on the Facebook pop-up) I still remain on the login page. There is no redirection. However, once I refresh the login page and then click the Facebook button again, there is no popup because it is already authorized by Facebook, instead it redirects to /user_session (for authentication via Facebook session) automatically and immediately takes me to the dashboard page as expected.

Additional Information:

Any idea why it doesn't redirect on the very first click, right after authorizing Facebook? The post-authorize URL is set for http:///user_session/ and the routes for authlogic are set properly.

I have tried with Prototype and jQuery, both give the same results.

You can see the same issue on this tutorial website if you try to authenticate with Facebook. This website is not mine so try at your own risk:
http://facebooker.pjkh.com

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愚人国度 2024-09-19 22:46:56

这里也有同样的问题。我认为它使用jquery对我没有做任何事情的原因是生成的代码

<%= authlogic_facebook_login_button :controller => 'customer_session' %>

类似于

  <form id='connect_to_facebook_form' method='post' action='/customer_session'>
    <input type='hidden' name='authenticity_token' value='keLV8CIfc5znsRkjhkjhkjhkjhkjh='/>
  </form>
  <script type='text/javascript' charset='utf-8'>
    function connect_to_facebook() {
      $('connect_to_facebook_form').submit();
    }
  </script>
  <fb:login-button js="prototype" onlogin="connect_to_facebook()"></fb:login-button>

jquery提交表单的代码是错误的,它应该是

$('#connect_to_facebook_form').submit();

(呃,因为我没有传入:js => ; :jquery)

但如果我解决了这个问题,我仍然会得到

1 个错误禁止该客户
会话被保存

存在以下问题
字段:

* 您没有提供任何身份验证详细信息

所以我猜正确的详细信息没有被注入到表单中

Also having the same issue here. I think the reason it was doing nothing for me, using jquery, is the code generated by

<%= authlogic_facebook_login_button :controller => 'customer_session' %>

which is something like

  <form id='connect_to_facebook_form' method='post' action='/customer_session'>
    <input type='hidden' name='authenticity_token' value='keLV8CIfc5znsRkjhkjhkjhkjhkjh='/>
  </form>
  <script type='text/javascript' charset='utf-8'>
    function connect_to_facebook() {
      $('connect_to_facebook_form').submit();
    }
  </script>
  <fb:login-button js="prototype" onlogin="connect_to_facebook()"></fb:login-button>

the jquery to submit the form is wrong it should be

$('#connect_to_facebook_form').submit();

(duh, because I did not pass in :js => :jquery)

but if I fix that I still get

1 error prohibited this customer
session from being saved

There were problems with the following
fields:

* You did not provide any details for authentication

so the right details are not being injected into the form I guess

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文