add token life by hour
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-01-05 16:26:46 +07:00
parent bd9ecd4f84
commit 0da0404488
16 changed files with 150 additions and 53 deletions
@@ -4,11 +4,12 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import ru.soune.nocopy.entity.AuthToken;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Optional;
@Repository
public interface AuthTokenRepository extends JpaRepository<AuthToken, Long> {
Optional<AuthToken> findByTokenAndExpiresAtAfter(String token, LocalDate expiresAtAfter);
Optional<AuthToken> findByLastUsedAtAndExpiresAtBefore(LocalDateTime lastUsedAt, LocalDateTime expiresAtBefore);
Optional<AuthToken> findByLastUsedAtBefore(LocalDateTime lastUsedAt);
Optional<AuthToken> findByToken(String token);
}