mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 08:33:24 +02:00
allow user to create an access token to access stf api from user settings tab.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user