|
|
@ -30,7 +30,7 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
$user = User::where('phone', $request->username)->first(); |
|
|
|
$user = User::where('phone', $request->username)->first(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(empty($user)){ |
|
|
|
if(empty($user)){ |
|
|
|
return response()->json(['status' =>false, 'msg' => 'Email hoặc SDT chưa được đăng ký.'], parent::HTTP_OK); |
|
|
|
return response()->json(['status' =>false, 'msg' => 'Email hoặc SĐT chưa được đăng ký.'], parent::HTTP_OK); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!Auth::attempt(['id' => $user->id, 'password' => $request->password])) { |
|
|
|
if (!Auth::attempt(['id' => $user->id, 'password' => $request->password])) { |
|
|
|
return response()->json(['status' =>false, 'msg' =>'Tài khoản hoặc mật khẩu không chính xác. Vui lòng thử lại.'], parent::HTTP_OK); |
|
|
|
return response()->json(['status' =>false, 'msg' =>'Tài khoản hoặc mật khẩu không chính xác. Vui lòng thử lại.'], parent::HTTP_OK); |
|
|
|