我如何设计/omniauth重定向到我登录的页面? [英] How do I have devise / omniauth redirect to the page from which I signed in from?

查看:80
本文介绍了我如何设计/omniauth重定向到我登录的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过omniauth进行了身份验证,并且该链接可通过layout/application.html.haml在每个页面上找到.

I have the authentication through omniauth and that link is available on every page through layout/application.html.haml.

但是,当他们完成omniauth身份验证时,他们都将成为root.

However, when they complete the omniauth authentication, they all go to root.

如何设置它,以便他们重定向到单击身份验证链接的实际页面(将其带到oauth提供者).

How can I set it up so they redirect to the actual page from which they clicked on the authentication link (which takes them to the oauth provider).

谢谢

推荐答案

您可以使用request.env['omniauth.origin'].

请参见 https://github.com/intridea/omniauth/wiki/Saving -用户位置

这篇关于我如何设计/omniauth重定向到我登录的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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