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:
parent
ddc24e5dc5
commit
62413b3780
21 changed files with 263 additions and 65 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue