php - Authenticate A User Instance not working Laravel 5.0 -


i try authenticate user nothing happens in controller

i next

$authuser = user::where('password', md5($user->salt . $request->get('password')))                   ->where('email', $request->get('email'))                   ->first(['login', 'email', 'firstname', 'lastname', 'zip_code','phone']); if ($authuser) {    auth::login($authuser);    return response()->json(['user' => $authuser]); } 

response returns me user next request error user not authenticated. idea?

hello it's happens because forgot add id field array of returned fields, try add like

$authuser = user::where('password', md5($user->salt . $request->get('password')))                   ->where('email', $request->get('email'))                   ->first(['id', 'login', 'email', 'firstname', 'lastname', 'zip_code','phone']); if ($authuser) {    auth::login($authuser);    return response()->json(['user' => $authuser]); } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -