将随机url参数传递给OmniAuth [英] Passing random url params to OmniAuth
问题描述
这里有一个链接示例: / 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}
这是一个回调。
参数被捕获在 env [omniauth.params ]
。
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.
Params are captured in env["omniauth.params"]
.
这篇关于将随机url参数传递给OmniAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!