Fixed user stuff again.
This commit is contained in:
parent
de13d001b8
commit
1097d0843f
|
@ -89,8 +89,7 @@ public class UserService {
|
||||||
user.getAccounts().add(account);
|
user.getAccounts().add(account);
|
||||||
user.setActivated(true);
|
user.setActivated(true);
|
||||||
user = userRepository.save(user);
|
user = userRepository.save(user);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
String token = StringUtils.random(64);
|
String token = StringUtils.random(64);
|
||||||
LocalDateTime expiresAt = LocalDateTime.now(ZoneOffset.UTC).plusHours(24);
|
LocalDateTime expiresAt = LocalDateTime.now(ZoneOffset.UTC).plusHours(24);
|
||||||
UserActivationToken activationToken = new UserActivationToken(token, user, expiresAt);
|
UserActivationToken activationToken = new UserActivationToken(token, user, expiresAt);
|
||||||
|
@ -101,6 +100,7 @@ public class UserService {
|
||||||
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Could not send activation email.");
|
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Could not send activation email.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void activateUser(String tokenString) {
|
public void activateUser(String tokenString) {
|
||||||
|
|
Loading…
Reference in New Issue