Skip to content

Commit 99f47a9

Browse files
committed
Fix bug in generating code
1 parent 7feed56 commit 99f47a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/identif.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Identif {
5050
*
5151
* @param {object} extra - The extra data to store.
5252
* @param {object} [options={}] - The options of request operation.
53+
* @param {number} [options.ttl] - The remaining time to live in the store.
5354
* @return {Object} The request information.
5455
*/
5556
async request(extra, options = {}) {
@@ -60,8 +61,8 @@ class Identif {
6061
const ttl = options.ttl || this.store.options.ttl;
6162
const data = {
6263
id: this.requestIdGenerator(),
63-
code: this.codeGenerator,
64-
expireAt: new Date(now.getTime() + (1000 * ttl)),
64+
code: this.codeGenerator(),
65+
ttl: ttl,
6566
createdAt: now
6667
};
6768
// state, action, channel

0 commit comments

Comments
 (0)