Commit c9a62925 by zCaesar

add endpoint ondelivery

parent 673488d8
var jwt = require('jsonwebtoken')
var config = require('config')
function verifyToken(token, callback) {
const verifyOptions = {
algorithms: ['RS256']
};
jwt.verify(token, config.get('pubca'), verifyOptions, (err, decoded) => {
callback(err, decoded)
})
}
module.exports.verifyToken = verifyToken
// signToken(role, '10000ms', (token) => {
// console.log(token)
// setInterval(() => {
// verifyToken(token, (err, decoded) => {
// if (err) {
// console.log(err)
// process.exit(0)
// }
// else console.log(decoded)
// })
// }, 5000)
// })
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment