astroanu said:
simply write your own logic on the AuthController.
Hi
Thank you for your reply. AuthController looks like it only has a construct method. I cant see clearly how to go about this. Any examples would be greatly appreciated.
The controller has a trait AuthenticatesAndRegistersUsers which uses trait AuthenticatesUsers. The AuthenticatesUsers trait has a postLogin function. You need to define your own postLogin function to override what's on the trait. Something like this would do. Assuming the passwords are stored with md5
public function postLogin(UserLoginRequest $request)
{
if (($user = User::where(['email' => $request->get('email'), 'password' => md5($request->get('password'))])->first()) instanceOf User) {
Auth::login($user);
// authenticated, redirect now
}
return $this->printJson(false, [], 'These credentials do not match our records.');
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community