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
殘留の回憶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
不是一般的人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);}}?>