Skip to content

Commit

Permalink
fix: Registration request throws a NullPointerException because of mi…
Browse files Browse the repository at this point in the history
…ssing setCreatedTimestamp call
  • Loading branch information
shorinami committed Jan 12, 2024
1 parent 08d8220 commit a04167b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import java.time.Instant;
import java.util.*;

@Service
Expand Down Expand Up @@ -41,6 +42,7 @@ public void createNewUser(SignupRequest signUpRequest) throws MessagingException
user.setPassword(passwordEncoder.encode(signUpRequest.getPassword()));
user.setAuthorities(Set.of(UserAuthority.USER));
user.setEnabled(true);
user.setCreatedTimestamp(Instant.now());

userRepository.save(user);
mailService.sendRegistrationMail(user);
Expand Down

0 comments on commit a04167b

Please sign in to comment.