php - Can't redirect after login success in laravel 5 authentication -
i have problem authentication in laravel 5, works if enter wrong username , password , error appear, when success, doesn't redirect dashboard, , no errors appear.
here's code 'authcontroller':
public function login(loginrequest $request){ $this->validate($request, [ 'username' => 'required', 'password' => 'required', ]); $remember = (input::get('remember')) ? true : false; if($this->auth->validate(['username' => input::get('username'),'password' => input::get('password'), 'active' => 1], $remember)){ return redirect('/dashboard'); }else{ return redirect('/login')->witherrors([ 'failed' => 'username or password invalid. please try again.', ]); } }
class authcontroller extends controller { protected $redirectto = '/'; protected $loginpath = '/login'; }
much easier....
Comments
Post a Comment