Skip to content
Snippets Groups Projects
Commit a84bab5d authored by Lars Brodin Østby's avatar Lars Brodin Østby
Browse files

Merge branch 'Refactor_CreateUser' into 'dev'

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

See merge request !89
parents bb78581a 8da1fad2
Branches hal
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 #77759 passed
...@@ -25,6 +25,10 @@ public class Login { ...@@ -25,6 +25,10 @@ public class Login {
public Login() { public Login() {
} }
public Login(User user) {
this.username = user.getUsername();
}
public Login(User user, String passwordSalt , String hash) { public Login(User user, String passwordSalt , String hash) {
this.username = user.getUsername(); this.username = user.getUsername();
this.user = user; this.user = user;
......
...@@ -46,7 +46,7 @@ public class UserService { ...@@ -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) { 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); User user = new User(username, email, firstName, lastName, callingCode, phoneNumber, birthDate);
Login login = new Login(user, "", ""); Login login = new Login(user);
setPassword(login, password); setPassword(login, password);
return userRepository.save(user); return userRepository.save(user);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment