{"action":"created","issue":{"url":"https://api.github.com/repos/Secbone/koa-session2/issues/29","repository_url":"https://api.github.com/repos/Secbone/koa-session2","labels_url":"https://api.github.com/repos/Secbone/koa-session2/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/Secbone/koa-session2/issues/29/comments","events_url":"https://api.github.com/repos/Secbone/koa-session2/issues/29/events","html_url":"https://github.com/Secbone/koa-session2/issues/29","id":214384340,"node_id":"MDU6SXNzdWUyMTQzODQzNDA=","number":29,"title":"Class constructor Store cannot be invoked without 'new'","user":{"login":"raminious","id":334716,"node_id":"MDQ6VXNlcjMzNDcxNg==","avatar_url":"https://avatars0.githubusercontent.com/u/334716?v=4","gravatar_id":"","url":"https://api.github.com/users/raminious","html_url":"https://github.com/raminious","followers_url":"https://api.github.com/users/raminious/followers","following_url":"https://api.github.com/users/raminious/following{/other_user}","gists_url":"https://api.github.com/users/raminious/gists{/gist_id}","starred_url":"https://api.github.com/users/raminious/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raminious/subscriptions","organizations_url":"https://api.github.com/users/raminious/orgs","repos_url":"https://api.github.com/users/raminious/repos","events_url":"https://api.github.com/users/raminious/events{/privacy}","received_events_url":"https://api.github.com/users/raminious/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-03-15T13:12:04Z","updated_at":"2018-12-11T05:48:29Z","closed_at":"2017-03-17T19:17:23Z","author_association":"NONE","body":"I got this error when try to use your package:\r\n\r\n```\r\n/opt/node/app/web/server/util/session-store/index.js:31\r\n    var _this = _possibleConstructorReturn(this, (RedisStore.__proto__ || Object.getPrototypeOf(RedisStore)).call(this));\r\n                                                                                                             ^\r\n\r\nTypeError: Class constructor Store cannot be invoked without 'new'\r\n    at new RedisStore (/opt/node/app/web/server/util/session-store/index.js:6:17)\r\n    at Object.<anonymous> (/opt/node/app/web/server/index.js:60:10)\r\n    at Module._compile (module.js:571:32)\r\n    at loader (/opt/node/app/web/node_modules/babel-register/lib/node.js:144:5)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/opt/node/app/web/node_modules/babel-register/lib/node.js:154:7)\r\n    at Module.load (module.js:488:32)\r\n    at tryModuleLoad (module.js:447:12)\r\n    at Function.Module._load (module.js:439:3)\r\n    at Module.require (module.js:498:17)\r\n    at require (internal/module.js:20:19)\r\n    at Object.<anonymous> (/opt/node/app/web/bin/server.js:1:1)\r\n    at Module._compile (module.js:571:32)\r\n    at loader (/opt/node/app/web/node_modules/babel-register/lib/node.js:144:5)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/opt/node/app/web/node_modules/babel-register/lib/node.js:154:7)\r\n    at Module.load (module.js:488:32)\r\n    at tryModuleLoad (module.js:447:12)\r\n    at Function.Module._load (module.js:439:3)\r\n    at Function.Module.runMain (module.js:605:10)\r\n    at Object.<anonymous> (/opt/node/app/web/node_modules/babel-cli/lib/_babel-node.js:154:22)\r\n    at Module._compile (module.js:571:32)\r\n    at Object.Module._extensions..js (module.js:580:10)\r\n    at Module.load (module.js:488:32)\r\n```\r\n\r\nStore.js\r\n```\r\nimport Redis from 'ioredis'\r\nimport { Store } from 'koa-session2'\r\n\r\nexport default class RedisStore extends Store {\r\n\r\n  constructor() {\r\n    super()\r\n    this.redis = new Redis()\r\n  }\r\n\r\n  async get(sid) {\r\n    const data = await this.redis.get(`SESSION:${sid}`)\r\n    return JSON.parse(data)\r\n  }\r\n\r\n  async set(session, { sid =  this.getID(24), maxAge = 1000000 } = {}) {\r\n    try {\r\n      // Use redis set EX to automatically drop expired sessions\r\n      await this.redis.set(`SESSION:${sid}`, JSON.stringify(session), 'EX', maxAge / 1000)\r\n    } catch (e) {}\r\n\r\n    return sid\r\n  }\r\n\r\n  async destroy(sid) {\r\n    return await this.redis.del(`SESSION:${sid}`)\r\n  }\r\n}\r\n\r\n```\r\n\r\napp:\r\n\r\n```\r\nimport RedisStore from './util/session-store'\r\n\r\napp.use(session({\r\n  key: 'MY_KEY',\r\n  httpOnly: false,\r\n  store: new RedisStore()\r\n}))\r\n```"},"comment":{"url":"https://api.github.com/repos/Secbone/koa-session2/issues/comments/446080614","html_url":"https://github.com/Secbone/koa-session2/issues/29#issuecomment-446080614","issue_url":"https://api.github.com/repos/Secbone/koa-session2/issues/29","id":446080614,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjA4MDYxNA==","user":{"login":"ilaipi","id":1689135,"node_id":"MDQ6VXNlcjE2ODkxMzU=","avatar_url":"https://avatars1.githubusercontent.com/u/1689135?v=4","gravatar_id":"","url":"https://api.github.com/users/ilaipi","html_url":"https://github.com/ilaipi","followers_url":"https://api.github.com/users/ilaipi/followers","following_url":"https://api.github.com/users/ilaipi/following{/other_user}","gists_url":"https://api.github.com/users/ilaipi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilaipi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilaipi/subscriptions","organizations_url":"https://api.github.com/users/ilaipi/orgs","repos_url":"https://api.github.com/users/ilaipi/repos","events_url":"https://api.github.com/users/ilaipi/events{/privacy}","received_events_url":"https://api.github.com/users/ilaipi/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T05:48:29Z","updated_at":"2018-12-11T05:48:29Z","author_association":"NONE","body":"@Secbone my node is 8.14.0 still not work."}}
{"actor":{"display_login":"ilaipi"}}