@@ -0,0 +1,1275 @@
+package com.membaza.api.users.service.purge;%0A%0Aimport com.membaza.api.users.persistence.repository.PasswordResetTokenRepository;%0Aimport com.membaza.api.users.persistence.repository.VerificationTokenRepository;%0Aimport org.springframework.scheduling.annotation.Scheduled;%0Aimport org.springframework.stereotype.Service;%0A%0Aimport javax.transaction.Transactional;%0Aimport java.time.Instant;%0Aimport java.util.Date;%0A%0Aimport static java.util.Objects.requireNonNull;%0A%0A/**%0A * @author Emil Forslund%0A * @since 1.0.0%0A */%0A@Service%0A@Transactional%0Apublic final class TokensPurgeService %7B%0A%0A    private final VerificationTokenRepository tokenRepository;%0A    private final PasswordResetTokenRepository passwordTokenRepository;%0A%0A    public TokensPurgeService(%0A            VerificationTokenRepository tokenRepository,%0A            PasswordResetTokenRepository passwordTokenRepository) %7B%0A%0A        this.tokenRepository         = requireNonNull(tokenRepository);%0A        this.passwordTokenRepository = requireNonNull(passwordTokenRepository);%0A    %7D%0A%0A    @Scheduled(cron = %22$%7Bpurge.cron.expression%7D%22)%0A    public void purgeExpired() %7B%0A        final Date now = Date.from(Instant.now());%0A        passwordTokenRepository.deleteAllExpiredSince(now);%0A        tokenRepository.deleteAllExpiredSince(now);%0A    %7D%0A%7D

Add expired token purger