Skip to content
Snippets Groups Projects
Commit 8da1fad2 authored by Mads Lundegaard's avatar Mads Lundegaard
Browse files

Added new Constructro to logn model and started using the new constructor in UserService

parent bb78581a
No related branches found
No related tags found
2 merge requests!104Weekly merge to Master,!89Added new Constructro to logn model and started using the new constructor in UserService
Pipeline #77746 passed
This commit is part of merge request !89. Comments created here will be created in the context of that merge request.
......@@ -25,6 +25,10 @@ public class Login {
public Login() {
}
public Login(User user) {
this.username = user.getUsername();
}
public Login(User user, String passwordSalt , String hash) {
this.username = user.getUsername();
this.user = user;
......
......@@ -46,7 +46,7 @@ public class UserService {
*/
public Optional<User> createUser(String email, String username, String firstName, String lastName, String callingCode, String phoneNumber, Date birthDate, String password) {
User user = new User(username, email, firstName, lastName, callingCode, phoneNumber, birthDate);
Login login = new Login(user, "", "");
Login login = new Login(user);
setPassword(login, password);
return userRepository.save(user);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment