Skip to main content

Class: OAuthRefreshToken

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:17

A refresh token tracked for OAuth 2.1 rotation, stored by hash so a database dump yields no usable credentials.

consumedAt marks a rotated token. Presenting one again is reuse, and createRefreshRotation revokes the whole (clientId, subject) token set — which is why the store adapter must report a live token's consumedAt as absent rather than as null.

Extends

  • Model

Constructors

Constructor

new OAuthRefreshToken(values?, options?): OAuthRefreshToken

Defined in: node_modules/.pnpm/sequelize-typescript@2.1.6_@types+node@26.1.1_@types+validator@13.15.10_reflect-metadat_4b56ff65ccbbb483836c71bec8c3693e/node_modules/sequelize-typescript/dist/model/model/model.d.ts:21

Parameters

ParameterType
values?Optional<any, string>
options?BuildOptions

Returns

OAuthRefreshToken

Inherited from

Model.constructor

Properties

clientId

clientId: string

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:31

The client_id the token was issued to.


consumedAt

consumedAt: Date | null

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:59

Instant the token was rotated (consumed), or null while it is live.


expiresAt

expiresAt: Date

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:52

Instant after which the token is invalid.


scopes

scopes: string[]

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:45

The scopes granted to this token.


subject

subject: string

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:38

The authenticated end-user subject identifier.


tokenHash

tokenHash: string

Defined in: packages/auth-postgresdb/src/models/OAuthRefreshToken.ts:24

SHA-256 hash (hex) of the opaque refresh token.