basalt / auth/src / MemoryRefreshTokenStore
Class: MemoryRefreshTokenStore
Defined in: auth/src/stores.ts:478
Implements
Constructors
Constructor
> new MemoryRefreshTokenStore(): MemoryRefreshTokenStore
Returns
MemoryRefreshTokenStore
Methods
create()
> create(record): Promise<void>
Defined in: auth/src/stores.ts:481
Parameters
record
Returns
Promise<void>
Implementation of
find()
> find(token): Promise<RefreshRecord | null>
Defined in: auth/src/stores.ts:485
Parameters
token
string
Returns
Promise<RefreshRecord | null>
Implementation of
markUsed()
> markUsed(token): Promise<boolean>
Defined in: auth/src/stores.ts:489
Consumes the refresh token. MUST be a compare-and-swap: mark it used only if it is still unused, and return whether THIS call did the consuming. Reuse detection depends on it — a plain UPDATE … WHERE token = ? lets two concurrent refreshes of a stolen+legitimate token both succeed. Returning void keeps the pre-CAS behaviour for stores written against the old contract.
Parameters
token
string
Returns
Promise<boolean>
Implementation of
revokeAllForUser()
> revokeAllForUser(userId): Promise<void>
Defined in: auth/src/stores.ts:502
Revokes every token of a user — fired on password reset. Optional.
Parameters
userId
string
Returns
Promise<void>
Implementation of
RefreshTokenStore.revokeAllForUser
revokeFamily()
> revokeFamily(familyId): Promise<void>
Defined in: auth/src/stores.ts:496
Revokes every token of a family — fired on reuse detection.
Parameters
familyId
string
Returns
Promise<void>