将随机 URL 参数传递给 OmniAuth
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参数在
env["omniauth.params"]
中捕获。Params are captured in
env["omniauth.params"]
.