RedisSessions

@accounts/redisGlobalsRedisSessions

Hierarchy

  • RedisSessions

Implements

  • DatabaseInterfaceSessions

Index

Constructors

Methods

Constructors

constructor

+ new RedisSessions(db: Redis, options: AccountsRedisOptions): RedisSessions

Defined in redis.ts:19

Parameters:

NameTypeDefault
dbRedis-
optionsAccountsRedisOptions{}

Returns: RedisSessions

Methods

createSession

createSession(userId: string, token: string, connection: ConnectionInformations, extraData?: object): Promise‹string›

Defined in redis.ts:33

Parameters:

NameTypeDefault
userIdstring-
tokenstring-
connectionConnectionInformations{}
extraData?object-

Returns: Promise‹string›


findSessionById

findSessionById(sessionId: string): Promise‹Session | null›

Defined in redis.ts:111

Parameters:

NameType
sessionIdstring

Returns: Promise‹Session | null›


findSessionByToken

findSessionByToken(token: string): Promise‹Session | null›

Defined in redis.ts:101

Parameters:

NameType
tokenstring

Returns: Promise‹Session | null›


invalidateAllSessions

invalidateAllSessions(userId: string, excludedSessionIds?: string[]): Promise‹void›

Defined in redis.ts:81

Parameters:

NameType
userIdstring
excludedSessionIds?string[]

Returns: Promise‹void›


invalidateSession

invalidateSession(sessionId: string): Promise‹void›

Defined in redis.ts:72

Parameters:

NameType
sessionIdstring

Returns: Promise‹void›


updateSession

updateSession(sessionId: string, connection: ConnectionInformations): Promise‹void›

Defined in redis.ts:62

Parameters:

NameType
sessionIdstring
connectionConnectionInformations

Returns: Promise‹void›