Skip to content

basalt / auth/src / SessionStore

Interface: SessionStore ​

Defined in: auth/src/stores.ts:404

Methods ​

create() ​

> create(userId, ttlMs): Promise<SessionRecord>

Defined in: auth/src/stores.ts:405

Parameters ​

userId ​

string

ttlMs ​

number

Returns ​

Promise<SessionRecord>


delete() ​

> delete(id): Promise<boolean>

Defined in: auth/src/stores.ts:408

Parameters ​

id ​

string

Returns ​

Promise<boolean>


deleteAllForUser()? ​

> optional deleteAllForUser(userId): Promise<void>

Defined in: auth/src/stores.ts:414

Deletes every session for a user — fired on password reset so a reset logs out all of the user's active sessions, not just token-based clients. Optional so existing stores keep compiling; implement it to close the gap.

Parameters ​

userId ​

string

Returns ​

Promise<void>


find() ​

> find(id): Promise<SessionRecord | null>

Defined in: auth/src/stores.ts:407

Returns null for unknown or expired sessions.

Parameters ​

id ​

string

Returns ​

Promise<SessionRecord | null>

Released under the MIT License.