Skip to main content

RefreshToken

The RefreshToken entity, mapped to the refresh_tokens table.

Tablerefresh_tokens
Tenant-scopedNo — global table
Columns8
Relationships1
Sourcebackend/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​

FieldTypeColumnNullNotes
refreshTokenIdLongrefresh_token_id—primary key, generated
tokenHashStringtoken_hash—unique
familyIdUUIDfamily_id—Links every token descended from the same login via rotation, so a reuse can revoke the whole chain.
issuedAtLocalDateTimeissued_at——
expiresAtLocalDateTimeexpires_at——
revokedAtLocalDateTimerevoked_atYes—
replacedByTokenHashStringreplaced_by_token_hashYes—
createdIpStringcreated_ipYes—

Relationships​

FieldKindTargetJoin columnRequired
user@ManyToOneUseruser_idYes

Neighbourhood​

Repository​

RefreshTokenRepository​

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

MethodReturnsNotes
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/.