1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 02:09:32 +02:00

allow user to create an access token to access stf api from user settings tab.

This commit is contained in:
Vishal Banthia 2015-11-19 19:50:33 +09:00
parent ddc24e5dc5
commit 62413b3780
21 changed files with 263 additions and 65 deletions

View file

@ -5,10 +5,12 @@ module.exports.encode = function(options) {
assert.ok(options.payload, 'payload required')
assert.ok(options.secret, 'secret required')
var expiry = options.expiry || Date.now() + 24 * 3600
return jws.sign({
header: {
alg: 'HS256'
, exp: Date.now() + 24 * 3600
, exp: expiry
}
, payload: options.payload
, secret: options.secret