title: how to add expire date to jwt-simple token
body: <pre><code>apiRoutes.post('/authenticate', function(req, res) {
    User.findOne({
      name: req.body.name
    }, function(err, user) {
      if (err) throw err;
  
      if (!user) {
        res.send({success: false, msg: 'Authentication failed. User not found.'});
      } else {
        // check if password matches
        user.comparePassword(req.body.password, function (err, isMatch) {
          if (isMatch &amp;&amp; !err) {
            // if user is found and password is right create a token
            var expires=moment().add(1,'days').valueOf();
            var token = jwt.encode(user, config.secret,{
            exp: expires});
            // return the information including token as JSON
            res.json({success: true, token: 'JWT ' + token});
          } else {
            res.send({success: false, msg: 'Authentication failed. Wrong password.'});
          }
        });
      }
    });
  });
  </code></pre>
  
  <p>It prompt error :
  /home/oracle/node/ang_backend1/node_modules/jwt-simple/lib/jwt.js:130
      throw new Error('Algorithm not supported');
      ^</p>
  
  <p>Error: Algorithm not supported
      at Object.jwt_encode [as encode] (/home/oracle/node/ang_backend1/node_modules/jwt-simple/lib/jwt.js:130:11)
      at /home/oracle/node/ang_backend1/app.js:198:27
      at /home/oracle/node/ang_backend1/app/models/user.js:48:9
      at /home/oracle/node/ang_backend1/node_modules/bcryptjs/dist/bcrypt.js:261:17
      at /home/oracle/node/ang_backend1/node_modules/bcryptjs/dist/bcrypt.js:1198:21
      at Immediate.next [as _onImmediate] (/home/oracle/node/ang_backend1/node_modules/bcryptjs/dist/bcrypt.js:1078:21)
      at processImmediate [as _immediateCallback] (timers.js:383:17)</p>