PasswordResetToken
The PasswordResetToken entity, mapped to the password_reset_tokens table.
| Table | password_reset_tokens |
| Tenant-scoped | No — global table |
| Columns | 7 |
| Relationships | 0 |
| Source | backend/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
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
id | Long | id | Yes | — |
userId | Long | user_id | — | — |
tenantId | Long | tenant_id | Yes | — |
tokenHash | String | token_hash | — | unique |
expiresAt | Instant | expires_at | — | — |
usedAt | Instant | used_at | Yes | — |
createdAt | Instant | created_at | — | — |
Repository
PasswordResetTokenRepository
Declared over PasswordResetToken with id type Long. Source: backend/src/main/java/com/motorph/payroll/repository/PasswordResetTokenRepository.java
| Method | Returns | Notes |
|---|---|---|
findByTokenHash(String tokenHash) | Optional<PasswordResetToken> | derived |
findFirstByUserIdOrderByCreatedAtDesc(Long userId) | Optional<PasswordResetToken> | derived |
countByUserIdAndCreatedAtAfter(Long userId, Instant since) | long | derived |
invalidateAllForUser(@Param("userId") Long userId, @Param("now") Instant now) | void | explicit @Query, modifying |
Reached by
These controllers hold — directly or through a service they depend on — a repository over PasswordResetToken.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| AuthController | /api/auth | 7 | Auth & 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/.