JHipster 如何增加新用户邮件激活的过期时间?

How to increase the expiration time for new user email activation in JHipster?

我想增加一个人注册时发送邮件的过期时间。

没看到过期时间是在哪里设置的

JHipster的注册激活邮件没有过期时间,但未激活的账号默认3天后删除。您可以在 UserService.java:

中更改此时间
/**
 * Not activated users should be automatically deleted after 3 days.
 * <p>
 * This is scheduled to get fired everyday, at 01:00 (am).
 */
@Scheduled(cron = "0 0 1 * * ?")
public void removeNotActivatedUsers() {
    userRepository
        .findAllByActivatedIsFalseAndActivationKeyIsNotNullAndCreatedDateBefore(Instant.now().minus(3, ChronoUnit.DAYS))
        .forEach(user -> {
            log.debug("Deleting not activated user {}", user.getLogin());
            userRepository.delete(user);
            this.clearUserCaches(user);
        });
}