首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Laravel + phpCAS:登录后,重定向回需要登录的同一页面

Laravel + phpCAS:登录后,重定向回需要登录的同一页面
EN

Stack Overflow用户
提问于 2018-04-11 17:06:48
回答 1查看 356关注 0票数 1

我正在开发一个使用Laravel的项目,其中我们使用phpCAS进行用户身份验证。我正在使用这个用于phpCAS的Laravel包:https://github.com/subfission/cas

在用户通过身份验证后,我希望将他/她返回到他/她被重定向到CAS服务器登录的URL。

我使用了url()->previous();但它在google chrome中返回了关于引用URL (控制器/动作)的错误信息。

我怎样才能做到这一点?谢谢!

EN

回答 1

Stack Overflow用户

发布于 2018-04-11 17:53:15

使用intended()方法

The intended method on the redirector will redirect the user to the URL they were attempting to access before being intercepted by the authentication middleware. A fallback URI may be given to this method in case the intended destination is not available.

示例:return redirect()->intended('dashboard');

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49770946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档