Modificar validacion de estado en usuarios. (LOGIN)
This commit is contained in:
parent
d1db9b9696
commit
9c0eea5bb1
@ -38,7 +38,7 @@ public function handleProviderCallback($provider)
|
|||||||
return response()->json(['error' => 'Credenciales de google invalidas.'], 422);
|
return response()->json(['error' => 'Credenciales de google invalidas.'], 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user = $user = User::where("email", "=", $userProvider->email)->first();
|
$user = $user = User::where("email", "=", $userProvider->email)->where("estado",true)->first();
|
||||||
|
|
||||||
if (isset($user)) {
|
if (isset($user)) {
|
||||||
$userCreated = User::updateOrCreate(
|
$userCreated = User::updateOrCreate(
|
||||||
@ -74,7 +74,7 @@ public function handleProviderCallback($provider)
|
|||||||
} else {
|
} else {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"status" => 0,
|
"status" => 0,
|
||||||
"message" => "Usuario no registrado en el sistema",
|
"message" => "Usuario no registrado o deshabilitado",
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public function login(Request $request)
|
|||||||
"password" => "required"
|
"password" => "required"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user = User::where("email", "=", $request->email)->first();
|
$user = User::where("email", "=", $request->email)->where("estado",true)->first();
|
||||||
|
|
||||||
if (isset($user->id)) {
|
if (isset($user->id)) {
|
||||||
if (Hash::check($request->password, $user->password)) {
|
if (Hash::check($request->password, $user->password)) {
|
||||||
@ -66,7 +66,7 @@ public function login(Request $request)
|
|||||||
} else {
|
} else {
|
||||||
return response()->json([
|
return response()->json([
|
||||||
"status" => 0,
|
"status" => 0,
|
||||||
"message" => "Usuario no registrado",
|
"message" => "Usuario no registrado o deshabilitado",
|
||||||
], 404);
|
], 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user