RefreshToken
The RefreshToken entity, mapped to the refresh_tokens table.
| Table | refresh_tokens |
| Tenant-scoped | No — global table |
| Columns | 8 |
| Relationships | 1 |
| Source | backend/src/main/java/com/motorph/payroll/model/RefreshToken.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 |
|---|---|---|---|---|
refreshTokenId | Long | refresh_token_id | — | primary key, generated |
tokenHash | String | token_hash | — | unique |
familyId | UUID | family_id | — | Links every token descended from the same login via rotation, so a reuse can revoke the whole chain. |
issuedAt | LocalDateTime | issued_at | — | — |
expiresAt | LocalDateTime | expires_at | — | — |
revokedAt | LocalDateTime | revoked_at | Yes | — |
replacedByTokenHash | String | replaced_by_token_hash | Yes | — |
createdIp | String | created_ip | Yes | — |
Relationships
| Field | Kind | Target | Join column | Required |
|---|---|---|---|---|
user | @ManyToOne | User | user_id | Yes |
Neighbourhood
Repository
RefreshTokenRepository
Declared over RefreshToken with id type Long. Source: backend/src/main/java/com/motorph/payroll/repository/RefreshTokenRepository.java
| Method | Returns | Notes |
|---|---|---|
findByTokenHash(String tokenHash) | Optional<RefreshToken> | derived |
findByFamilyIdAndRevokedAtIsNull(UUID familyId) | List<RefreshToken> | derived |
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/.