feat(user/controller): añadida comprobación de usuario inactivo en el login

parent 1d7ad322
......@@ -51,6 +51,10 @@ public class AuthController {
try {
User user = readUserService.readByEmail(loginRequest.getEmail());
if (user.getDeletedAt() != null)
return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
.body(Collections.singletonMap("message", "Usuario inactivo, para reactivar contacte con admin@example.com"));
if (!passwordEncoder.matches(loginRequest.getPassword(), user.getPassword()))
return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
.body(Collections.singletonMap("message", "Contraseña incorrecta"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment