Why are you using redirect guest? And you are not using password to login?! Also your code has not a fallback... so if the user is not found (do not enter on the IF, a blank page will be shown!
Aug 24, 2016
8
Level 1
Laravel not Redirecting after manual user Authentication?
##In LoginController.php I want to redirect user to home page.but it always shows blank page after authenticating user.
public function authenticater($data,$request)
{
$email=$data['email'];
$check=User::where('email', '=',$email)->first();
//if not found means we need to register the user
if ($check != null) {
// Authentication passed.....
$id=intval($check->id);
Auth::loginUsingId($id,true);
//echo '<html><script>setTimeout(function(){ window.history.go(-1); }, 3000);</script></html>';
//echo '<html><script>location.href="/";</script></html>';
return redirect()->guest(route('home'));
}
Level 1
Was using Socialite so didn't require password. that was just a part of module. btw, my mistake was: i called authenticater() from another method of controller.So,control was going to caller method.
$this->authenticater($data,$request);
return redirect('/home');
Solved. ..
anway,thank you @ EliasSoares. :)
Please or to participate in this conversation.