gpt4 book ai didi

facebook - 尝试取消弹出窗口时 Omniauth+facebook 错误

转载 作者:行者123 更新时间:2023-11-30 05:21:56 27 4
gpt4 key购买 nike

我在我的 Rails 应用程序中使用 omniauth-facebook gem 以允许用户通过 facebook 登录/注册。它运作良好。但我的问题是当我点击取消按钮时出现以下错误

(facebook) Callback phase initiated.
(facebook) Authentication failure! invalid_credentials: OmniAuth::Strategies::OAuth2::CallbackError, OmniAuth::Strategies::OAuth2::CallbackError


Started GET "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request." for 127.0.0.1 at 2012-05-18 11:42:36 +0530

怎么了?添加 /auth/failure => 'pages#home' 也不起作用。请帮忙

最佳答案

看看关于 https://github.com/intridea/omniauth/wiki/FAQ 的最后一节看看是否有帮助。它建议添加

OmniAuth.config.on_failure = Proc.new { |env|
OmniAuth::FailureEndpoint.new(env).redirect_to_failure
}

到你的 omniauth 初始化器。这在本地对我有用,然后您只需要定义您的/auth/failure 路由和操作。

关于facebook - 尝试取消弹出窗口时 Omniauth+facebook 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10647642/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com