在 Omniauth 请求中传递自定义信息

发布于 2024-12-25 08:28:39 字数 534 浏览 3 评论 0原文

我目前正在为一个应用程序实现一个omniauth 解决方案,该应用程序最初将处于仅限邀请模式。我可以限制 UI,以便人们无法看到可以激活omniauth 的注册屏幕,除非他们拥有有效的邀请码。话虽这么说,如果用户知道 url 结构,他们可以尝试直接启动omniauth 进程,我正在尝试找出如何处理它。我无法锁定身份验证网址,因为已注册的用户需要通过这些网址,并且在初始注册后他们不会获得邀请码。理想情况下,我想在omniauth请求中传递邀请码,以便成功后它会返回到应用程序,但在查看时我发现这个线程说这是不可能的。

http://groups.google.com/group/omniauth/browse_thread/thread/4d99d608 ... 这仍然是真的吗?或者现在可以做我正在寻找的事情吗?在会话中设置值是否仍然是首选方法,或者在使用 OmniAuth 时是否有更好的方法来处理此问题? 提前致谢 克里斯

I'm currently implementing an omniauth solution for an app that will initially be in an invite only mode.  I can restrict the UI so that a person cannot see the registration screen from which omniauth could be activated unless they have a valid invitation code.  That being said, if a user knew the url structure, they could try to initiate the omniauth process directly and I'm trying to figure out how to handle that.  I can't lock down the authentication url because an already registered user would need to go through them and they would not have their invitation code after the initial registration.  Ideally I'd like to pass the invitation code along in the omniauth request so that it would come back to the app upon success, but in looking I found this thread which said that is not possible.

http://groups.google.com/group/omniauth/browse_thread/thread/4d99d608...
Is this still true or is it now possible to do what I'm looking for? Is setting the value in the session still the preferred way or is there a better way to handle this when using OmniAuth?
Thanks in advance
Chris

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

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

发布评论

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

评论(1

淡淡離愁欲言轉身 2025-01-01 08:28:39

您可以首先将信息存储到某个位置(例如会话),而不是随omniauth 请求一起传递自定义信息。在oauth回调中,检查当前会话的邀请码,如果可用,则注册用户。

Instead of passing the custom info along with the omniauth request, you can first store the info to somewhere (like session). And in the oauth callback, you check the invitation code of current session, if it's available, register the user.

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