Fix password hash

This commit is contained in:
jeffcheasey88 2023-02-15 23:20:42 +01:00
parent 4993cc33ee
commit c953971ef3
4 changed files with 4 additions and 2 deletions

View file

@ -5,5 +5,6 @@
<classpathentry exported="true" kind="lib" path="json-simple-1.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="mysql-connector-java-8.0.28.jar"/>
<classpathentry exported="true" kind="lib" path="password4j-1.6.3.jar"/>
<classpathentry exported="true" kind="lib" path="slf4j-api-2.0.6.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

BIN
slf4j-api-2.0.6.jar Normal file

Binary file not shown.

View file

@ -7,6 +7,8 @@ import java.sql.DriverManager;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.password4j.Password;
import be.jeffcheasey88.peeratcode.repository.DatabaseRepository;
import be.jeffcheasey88.peeratcode.routes.ChapterElement;
import be.jeffcheasey88.peeratcode.routes.ChapterList;
@ -47,7 +49,6 @@ public class Main {
initRoutes(router, new DatabaseRepository(con));
ServerSocket server = new ServerSocket(80);
while(!server.isClosed()){

View file

@ -163,7 +163,7 @@ public class DatabaseRepository {
PreparedStatement statement = con.prepareStatement(REGISTER_QUERY);
statement.setString(1, pseudo);
statement.setString(2, email);
statement.setString(3, hash.toString());
statement.setString(3, hash.getResult());
statement.setString(4, firstname);
statement.setString(5, lastname);
statement.setString(6, description);