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
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 #77759 passed
......@@ -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