Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/react-server / src / deps / session / SessionStore.ts
Size: Mime:
/**
 * @description this is because memory store will leak memory
 * @todo this api sucks
 * @todo  this is a YAGNI along with all of session
 *        MAYBE it will be helpful wit jwt
 *        if it doesn't impact then fine
 *        but otherwise it should only
 *        be a middleware checking a cookie
 *
 *
 * @see https://www.npmjs.com/package/session-file-store
 * @see https://github.com/roccomuso/memorystore/blob/master/lib/memorystore.js
 * @see https://github.com/expressjs/session#compatible-session-stores
 *
 * @api @type https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express-session/index.d.ts
 */
function sessionStore(session) {
  const Store = session.Store

  class SessionStore extends Store {
    constructor(options = {}) {
      super(options)
      this.options = options
    }

    get(sessionId, callback) {
      //
    }
    set(sessionId, session, callback) {
      //
    }
    touch(sessionId, session, callback) {
      // if it exists
    }
    destroy(sessionId, callback) {
      // remove session
    }

    length(callback) {
      // number of sessions
    }

    clear(callback) {
      // clear all sessions
    }

    list(callback) {
      // all
    }

    expired(sessionId, callback) {
      // @alias isExpired
    }
  }

  return Store
}