diff --git a/backend/gamelink/src/main/java/urjc/gamelink/Controllers/GamelinkController.java b/backend/gamelink/src/main/java/urjc/gamelink/Controllers/GamelinkController.java index 0c6562d..6a1a101 100644 --- a/backend/gamelink/src/main/java/urjc/gamelink/Controllers/GamelinkController.java +++ b/backend/gamelink/src/main/java/urjc/gamelink/Controllers/GamelinkController.java @@ -309,14 +309,19 @@ public String signin(Model model){ } @PostMapping("/signin") - public String signin(Model model, @RequestParam (required = true) Usero user, @RequestParam String password){ + public String signin(Model model, Usero user, @RequestParam (required = true) String name, @RequestParam String email, + @RequestParam String password, @RequestParam String nick, @RequestParam String lastName){ - if (user.getName().equals("") || user.getName() == null){ + if (name.equals("") || name == null){ return "errorMessage"; } ArrayList lista = new ArrayList<>(); lista.add("USERO"); + user.setName(name); + user.setEmail(email); + user.setNick(nick); + user.setLastName(lastName); user.setRoles(lista); user.setEncodedPassword(passwordEncoder.encode(password)); diff --git a/backend/gamelink/src/main/java/urjc/gamelink/Service/dbInit.java b/backend/gamelink/src/main/java/urjc/gamelink/Service/dbInit.java index 865f174..ef788e7 100644 --- a/backend/gamelink/src/main/java/urjc/gamelink/Service/dbInit.java +++ b/backend/gamelink/src/main/java/urjc/gamelink/Service/dbInit.java @@ -224,7 +224,7 @@ public void init() throws IOException, URISyntaxException { /* inserting users into the database */ - Usero usr = new Usero("usera", "useraPepe", "Uno", "usuario1@gmail.com"); + Usero usr = new Usero("user", "usuario", "usuarioLastname", "usuario1@gmail.com"); usr.setEncodedPassword(passwordEncoder.encode("123")); ArrayList roles1 = new ArrayList<>(); roles1.add("USERO"); @@ -241,7 +241,7 @@ public void init() throws IOException, URISyntaxException { usr2.setRoles(roles2); us.save(usr2); - Usero usr3 = new Usero("admin", "adminPepe", "Uno", "admin@123.com"); + Usero usr3 = new Usero("admin", "adminName", "adminLastName", "admin@123.com"); usr3.setEncodedPassword(passwordEncoder.encode("123")); ArrayList roles3 = new ArrayList<>(); roles3.add("USERO"); diff --git a/backend/gamelink/src/main/resources/application.properties b/backend/gamelink/src/main/resources/application.properties index b3aedab..06d1d0d 100644 --- a/backend/gamelink/src/main/resources/application.properties +++ b/backend/gamelink/src/main/resources/application.properties @@ -10,7 +10,7 @@ spring.mustache.suffix=.html spring.datasource.url=jdbc:postgresql://localhost/gamelink spring.datasource.username=postgres -spring.datasource.password=Universum3 +spring.datasource.password=password spring.jpa.hibernate.ddl-auto=create-drop logging.level.org.springframework.security=DEBUG diff --git a/backend/gamelink/src/main/resources/templates/signin.html b/backend/gamelink/src/main/resources/templates/signin.html index e578a54..c93d46c 100644 --- a/backend/gamelink/src/main/resources/templates/signin.html +++ b/backend/gamelink/src/main/resources/templates/signin.html @@ -25,7 +25,7 @@

Registro

-
+
@@ -37,7 +37,7 @@

Registro

- +
diff --git a/backend/gamelink/target/classes/application.properties b/backend/gamelink/target/classes/application.properties index b3aedab..06d1d0d 100644 --- a/backend/gamelink/target/classes/application.properties +++ b/backend/gamelink/target/classes/application.properties @@ -10,7 +10,7 @@ spring.mustache.suffix=.html spring.datasource.url=jdbc:postgresql://localhost/gamelink spring.datasource.username=postgres -spring.datasource.password=Universum3 +spring.datasource.password=password spring.jpa.hibernate.ddl-auto=create-drop logging.level.org.springframework.security=DEBUG