Interface PasswordResetTokenRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<PasswordResetToken,,Long> org.springframework.data.jpa.repository.JpaRepository<PasswordResetToken,,Long> org.springframework.data.repository.ListCrudRepository<PasswordResetToken,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<PasswordResetToken,,Long> org.springframework.data.repository.PagingAndSortingRepository<PasswordResetToken,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<PasswordResetToken>,org.springframework.data.repository.Repository<PasswordResetToken,Long>
public interface PasswordResetTokenRepository
extends org.springframework.data.jpa.repository.JpaRepository<PasswordResetToken,Long>
-
Method Summary
Modifier and TypeMethodDescriptionlongcountByIpAddressAndExpiresAtAfter(String ipAddress, OffsetDateTime expiresAfter) Same recency approximation, keyed by the requester's IP.longcountByUserAndExpiresAtAfter(User user, OffsetDateTime expiresAfter) Requests made recently by this user.findByToken(String tokenHash) Lookup by the SHA-256 hash of the raw token.Outstanding (not yet consumed) tokens of a user, for invalidation.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByToken
Lookup by the SHA-256 hash of the raw token. -
findByUserAndUsedAtIsNull
Outstanding (not yet consumed) tokens of a user, for invalidation. -
countByUserAndExpiresAtAfter
Requests made recently by this user. The table has no created_at column, so recency is derived from expires_at (creation + TTL): a token created within the lastwindowhasexpires_at > now - window + ttl. -
countByIpAddressAndExpiresAtAfter
Same recency approximation, keyed by the requester's IP.
-