From b930a8f75f168d53a932a6d90fe5d2b5810621d7 Mon Sep 17 00:00:00 2001 From: Drasko DRASKOVIC Date: Sat, 5 Dec 2015 19:04:42 +0100 Subject: [PATCH] Add `utils` dir and generateToken.js utility Signed-off-by: Drasko DRASKOVIC --- utils/generateToken.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 utils/generateToken.js diff --git a/utils/generateToken.js b/utils/generateToken.js new file mode 100644 index 00000000..61e3c3d6 --- /dev/null +++ b/utils/generateToken.js @@ -0,0 +1,9 @@ +var jwt = require('jsonwebtoken'); + +var config = require('../config/config'); + +var token = jwt.sign({foo: 'bar'}, config.tokenSecret, { + expiresInMinutes: config.userTokenExpirePeriod +}); + +console.log(token);