Skip to main content

PasswordResetToken

The PasswordResetToken entity, mapped to the password_reset_tokens table.

Tablepassword_reset_tokens
Tenant-scopedNo — global table
Columns7
Relationships0
Sourcebackend/src/main/java/com/motorph/payroll/model/PasswordResetToken.java
Not tenant-scoped

This entity does not extend TenantOwned, so its rows are shared across every tenant. TenantCoverageTest allows that only for tables deliberately declared global.

Columns​

FieldTypeColumnNullNotes
idLongidYes—
userIdLonguser_id——
tenantIdLongtenant_idYes—
tokenHashStringtoken_hash—unique
expiresAtInstantexpires_at——
usedAtInstantused_atYes—
createdAtInstantcreated_at——

Repository​

PasswordResetTokenRepository​

Declared over PasswordResetToken with id type Long. Source: backend/src/main/java/com/motorph/payroll/repository/PasswordResetTokenRepository.java

MethodReturnsNotes
findByTokenHash(String tokenHash)Optional<PasswordResetToken>derived
findFirstByUserIdOrderByCreatedAtDesc(Long userId)Optional<PasswordResetToken>derived
countByUserIdAndCreatedAtAfter(Long userId, Instant since)longderived
invalidateAllForUser(@Param("userId") Long userId, @Param("now") Instant now)voidexplicit @Query, modifying

Reached by​

These controllers hold — directly or through a service they depend on — a repository over PasswordResetToken.

ControllerBase pathEndpointsModule
AuthController/api/auth7Auth & Identity

Generated page

This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.