src/index.js
// Used for email verification and for reset password
Used for email verification and for reset password
Used for email verification and for reset password
generateVerificationToken(expirationSeconds) {
    return new Promise((resolve, reject) => {
      crypto.randomBytes(20, (err, buf) => {
        var token = buf.toString('hex');
        var expiration = Date.now() + (expirationSeconds * 1000);
        err ? reject(err) : resolve({ token, expiration });
      });
    });
  }
generateVerificationToken ( expirationSeconds ) { return new Promise ( ( resolve , reject ) => { crypto . randomBytes ( 20 , ( err , buf ) => { var token = buf . toString ( 'hex' ) ; var expiration = Date . now ( ) + ( expirationSeconds * 1000 ) ; err ? reject ( err ) : resolve ( { token , expiration } ) ; } ) ; } ) ; }
Used for email verification and for reset password
Used for email verification and for reset password