I put the function below in the LoginController class to redirect users to different views, and when after login I got this 419|expired page.
JavaScript
x
protected function authenticated(Request $request, $user) {
if ($user->PRIVILEGE == 'C') {
return redirect()->route('/users');
} else if ($user->PRIVILEGE == 'B') {
return redirect('/blog');
} else {
return redirect('/');
}
}
Advertisement
Answer
First put this in your LoginController class: use IlluminateSupportFacadesAuth;
comment out this line protected $redirectTo =… and also add this function in the LoginController class:
public function redirectPath() {
JavaScriptif(Auth::user()->privilege =='C'){
return '/users';
}
if(Auth::user()->privilege=='B'){
return '/blog';
}
}