Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionService

Session services.

Hierarchy

Constructors

constructor

Properties

Readonly dbm

dbm: default

Methods

createSession

  • createSession(userID: string, prune?: boolean): Promise<string>
  • Create a session.

    Parameters

    • userID: string

      The ID of the user associated with the session.

    • prune: boolean = true

      Whether or not to prune the session when the time comes.

    Returns Promise<string>

    The new session's ID.

deleteSession

  • deleteSession(sessionID: string): Promise<void>
  • Delete a session.

    Parameters

    • sessionID: string

      A session's ID.

    Returns Promise<void>

deleteUserSessions

  • deleteUserSessions(userID: string): Promise<void>
  • Delete all of a user's sessions.

    Parameters

    • userID: string

      A user's ID.

    Returns Promise<void>

getSession

  • getSession(sessionID: string): Promise<Session>
  • Get a session.

    Parameters

    • sessionID: string

      A session's ID.

    Returns Promise<Session>

    The session.

getUserBySessionID

  • getUserBySessionID(sessionID: string): Promise<User>
  • Get a user by session ID.

    Parameters

    • sessionID: string

      A session's ID.

    Returns Promise<User>

    The user associated with the session.

getUserIDBySessionID

  • getUserIDBySessionID(sessionID: string): Promise<string>
  • Get a user ID by session ID.

    Parameters

    • sessionID: string

      A session's ID.

    Returns Promise<string>

    The ID of the user associated with the session.

getUserSessions

  • getUserSessions(userID: string): Promise<Session[]>
  • Get all of a user's sessions.

    Parameters

    • userID: string

      A user's ID.

    Returns Promise<Session[]>

    A list of all sessions associated with the user.

sessionExists

  • sessionExists(sessionID: string): Promise<boolean>
  • Check if a session exists.

    Parameters

    • sessionID: string

      A session's ID.

    Returns Promise<boolean>

    Whether or not the session exists.

updateSession

  • updateSession(sessionID: string, prune?: boolean): Promise<void>
  • Update the timestamp at which the session ID was last used.

    Parameters

    • sessionID: string

      A session's ID.

    • prune: boolean = true

    Returns Promise<void>

Generated using TypeDoc