|
|
@@ -28,7 +28,7 @@ class LoginController extends Controller{
|
|
|
'email' => 'required|string|email',
|
|
|
'password' => 'required|string'
|
|
|
]);
|
|
|
-
|
|
|
+
|
|
|
if($validator->fails()){
|
|
|
return $this->responseController->makeResponse(
|
|
|
true,
|
|
|
@@ -39,10 +39,10 @@ class LoginController extends Controller{
|
|
|
401
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$login = $request->all();
|
|
|
$usr = DB::table('samusua')->where('USUA_EMAI', '=', $login['email'])->first();
|
|
|
-
|
|
|
+
|
|
|
if(is_null($usr)){
|
|
|
return $this->responseController->makeResponse(true, "El correo electrónico no está registrado.", [], 404);
|
|
|
}
|
|
|
@@ -60,14 +60,14 @@ class LoginController extends Controller{
|
|
|
"iss" => $login['email'],
|
|
|
"aud" => "dominio.syp.mx",
|
|
|
"iat" => $iat,
|
|
|
- "cad" => $cad
|
|
|
+ "cad" => $cad
|
|
|
];
|
|
|
|
|
|
$token = JWT::encode($payload, $this->secretKey, 'EdDSA');
|
|
|
|
|
|
return $this->responseController->makeResponse(false, "EXITO.", [
|
|
|
"IDUSUARIO" => $this->encryptionController->encrypt($usr->USUA_IDUS),
|
|
|
- "NOMREUSUARIO" => $this->encryptionController->encrypt($usr->USUA_NOMB),
|
|
|
+ "NOMBREUSUARIO" => $this->encryptionController->encrypt($usr->USUA_NOMB),
|
|
|
"CORREO" => $this->encryptionController->encrypt($usr->USUA_EMAI),
|
|
|
"TOKEN" => $token,
|
|
|
]);
|