将随机 URL 参数传递给 OmniAuth

发布于 2024-12-13 22:51:42 字数 446 浏览 8 评论 0原文

我正在使用omniauth 和devise,我想知道如何传递url 参数并访问它们。

以下是链接示例:/accounts/auth/facebook?do_something_after_return=1 现在我希望能够在回调中检索此 do_something_after_return 。我不在乎它是保存在会话中还是其他地方。问题是,我不知道在哪里可以拦截这个参数。

链接 /accounts/auth/facebook 指向的控制器和操作是什么? 路线什么也没告诉我,它根本不存在。我在路线中所拥有的就是这个 /accounts/auth/:provider(.:format {:controller=>"accounts/omniauth_callbacks", :action=>"passthru"} 这是一个打回来。

I'm using omniauth with devise and I'm wondering how to pass url params and access them.

Here's a link example: /accounts/auth/facebook?do_something_after_return=1
Now I want to be able to retrieve this do_something_after_return in the callback. I don't care if it's saved in session or elsewhere. Problem is, I don't know where can I intercept this param.

What is the controller and the action that link /accounts/auth/facebook points to?
Routes tell me nothing, it's simply not there. All I have in the routes is this /accounts/auth/:provider(.:format {:controller=>"accounts/omniauth_callbacks", :action=>"passthru"} which is a callback.

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

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

发布评论

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

评论(1

滥情空心 2024-12-20 22:51:42

参数在 env["omniauth.params"] 中捕获。

Params are captured in env["omniauth.params"].

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