du0173 2015-12-28 21:31
浏览 93

Laravel身份验证重定向错误

I am new to Laravel so please excuse my ignorance. I am going through the beginner tutorials and have gotten stuck on the built in authentication system...

I have created a new app and followed the docs on setting up authentication, I searched through stack overflow and overcame one issue (I had to put the auth routes in the middleware group), however now no matter what I do it redirects to the root "/" path...even when I manually go to auth/logout and then auth/login...can someone please help?

  • 写回答

2条回答 默认 最新

  • dpl22899 2015-12-28 21:55
    关注

    I think I misunderstood, your routes should look like this.

    Route::get('auth/login', 'Auth\AuthController@getLogin');
    Route::post('auth/login', 'Auth\AuthController@postLogin');
    Route::get('auth/logout', 'Auth\AuthController@getLogout');
    

    and you should have at the very least the login.blade.php template in your Auth folder (in views).

    If you truly are going to start again, consider deleting the question as it doesn't really help anyone in it's current state.


    Try this in your Auth controller

        public function authenticated( $request,  $user ) {
            return redirect()->intended($this->redirectPath().'?success');
        }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题