Home  >  Q&A  >  body text

laravel5.8 front desk auth login cannot

I am a student in the eighth phase of the PHP online class. I followed the laravel auth video of Teacher Ximen to expand a front-end login function. However, after the login process was completed, the transfer to the next page was intercepted by the middleware, and there was no error in the code execution. Just got intercepted. The following is the code. Please help me see it

不是一般的人不是一般的人1644 days ago2171

reply all(4)I'll reply

  • 殘留の回憶

    殘留の回憶2020-05-13 13:20:25

    F12, you can view the specific information that was intercepted in the network, there is a specific error status code, the comparison reports 419, that is, the csrf verification failed

    reply
    0
  • 不是一般的人

    There is no error. It seems that the logic is reversed somewhere, or there is no session in the system after logging in.

    不是一般的人 · 2020-05-13 13:22:37
  • 不是一般的人

    不是一般的人2020-05-12 18:24:55

    登录.jpg

    扩展.png

    模型.png中间件.jpg注册中间件.jpg

    reply
    1
  • 不是一般的人

    不是一般的人2020-05-12 18:17:52

    这个中间件

    <?php namespace App\Http\Middleware;use Closure;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Auth;/*** Permission verification middleware*/ class AuthMember { public function handle($request,Closure $next,$guard=null){ if(Auth::guard('member')->guest()){ if($request->ajax()){ return response('error',401); } return redirect()->guest('/?login=1'); } return $next($request);}}?>

    reply
    0
  • Cancelreply