smartmirrordisplay - v1.0.0
    Preparing search index...

    Class AuthService

    Handles account management and session lifecycle. Sessions are stored in SQLite and mirrored in an in-memory cache for fast token lookups. Expired sessions are purged from both on construction and on access.

    Index
    db: BetterSQLite3Database<js/db/schema> & {}
    sessionCache: Map<string, Session> = ...
    • Parameters

      • username: string
      • displayName: string
      • role: UserRole
      • password: string

      Returns void

      if the username is already taken.

    • Deletes an account and invalidates all its active sessions.

      Parameters

      • username: string

      Returns void

      if the user does not exist.

    • Returns void

    • Validates a token and returns public session info, or null if missing or expired.

      Parameters

      • token: string

      Returns SessionInfo | null

    • Parameters

      • password: string
      • salt: string

      Returns string

    • Returns { displayName: string; role: string; username: string }[]

    • Returns void

    • Returns a new session on success, null on bad credentials (never throws).

      Parameters

      • username: string
      • password: string

      Returns Session | null

    • Parameters

      • token: string

      Returns void

    • Parameters

      • cookieHeader: string | undefined
      • name: string

      Returns string | undefined

    • Parameters

      • username: string
      • updates: { displayName?: string; password?: string; role?: UserRole }

      Returns void

      if the user does not exist.