irongit
Explore
Docs
Sign in
Register
huncholane
/
defi_property
Public
Code
Commits
Branches
Tags
main
defi_property
/
server
/
providers
/
token.provider.js
10 lines
309 B
JavaScript
Raw
Download
History
1
const
jwt
=
require
(
'
jsonwebtoken
'
)
;
2
3
var
secretKey
=
require
(
'
../config/config
'
)
.
secretKey
;
4
5
//
getAuthToken() {
6
//
var token = jwt.sign({ foo: 'bar' }, secretKey, { algorithm: 'RS256'});
7
//
}
8
jwt
.
sign
(
{
foo
:
'
bar
'
}
,
secretKey
,
{
algorithm
:
'
RS256
'
}
,
function
(
err
,
token
)
{
9
console
.
log
(
token
)
;
10
}
)
;