如何增加JHipster中新用户电子邮件激活的到期时间?

我想增加一个人注册后发送的邮件的有效期限。

我看不到到期时间在哪里设置

icem_net 回答:如何增加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);
        });
}
本文链接:https://www.f2er.com/3101852.html

大家都在问