我使用的是laravel 5.2,我在AuthController中编写了此函数,但它根本不起作用
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) {
// The user is active, not suspended, and exists.
return redirect()->intended('/');// return $next($request);
}
else {
return redirect('/login');// return response('Unauthorized.', 401);
}
}
怎么了?