otro cambio, no se que hize, help

This commit is contained in:
Daniel Cortés
2019-05-29 00:29:56 -04:00
parent e4c7e8f282
commit 69a45d2ad6
2 changed files with 9 additions and 2 deletions

View File

@@ -37,8 +37,15 @@ public class LoginController {
String name = this.view.getUserField().getText();
Optional<Usuario> optionalUser = this.repository.getByName(name);
if (optionalUser.isEmpty())
if (optionalUser.isEmpty()) {
JOptionPane.showMessageDialog(
null,
"El usuario o contraseña son incorrectos",
"Error",
JOptionPane.ERROR_MESSAGE
);
return;
}
Usuario user = optionalUser.get();
byte[] pass = Hash.sha256(new String(this.view.getPassField().getPassword()).getBytes(StandardCharsets.UTF_8));

View File

@@ -9,7 +9,7 @@
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/biblioteca_manual"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/biblioteca"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.password" value="ff9800s_a_d"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MariaDB103Dialect"/>