我已按照以下链接在我的laravel应用中提供Login With LinkedIn
。
https://itsolutionstuff.com/post/laravel-5-login-with-linkedin-using-socialite-packageexample.html
全部工作正常,我已成功登录于likesin。
但问题是当用户第一次点击我的网站上的Login With Linked按钮时,它会重定向到链接页面显示带Ok和Cancle按钮的Dialog,现在如果用户点击cancle按钮,则显示错误
浏览器网址为:
我想当用户点击cancle按钮时,它只是重定向到我网站的主页。
在LinkedIn Developer Console上我添加了以下网址:
OAuth 2.0
授权重定向网址:
http://www.mywebsite.com/auth/linkedin/callback
OAuth 1.0a
默认"接受"重定向网址:
http://www.mywebsite.com/auth/linkedin
默认"取消"重定向网址:
http://www.mywebsite.com/
请帮我解决这个问题。
答案 0 :(得分:1)
你应该试试这个:
在Contoller方法中,为http://www.mywebsite.com/auth/linkedin/callback
if($request->has('error')){
return redirect()
->to('admin/login')
->withErrors("Access Denied");
}