将随机 url 参数传递给 OmniAuth [英] Passing random url params to OmniAuth

查看:33
本文介绍了将随机 url 参数传递给 OmniAuth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有设计的 omniauth,我想知道如何传递 url 参数并访问它们.

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

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

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.

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

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.

推荐答案

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

这篇关于将随机 url 参数传递给 OmniAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆