You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
planka_custom/server/api/helpers/sign-token.js

19 lines
291 B
JavaScript

const jwt = require('jsonwebtoken');
module.exports = {
sync: true,
inputs: {
payload: {
type: 'json',
required: true,
},
},
fn(inputs, exits) {
const token = jwt.sign(inputs.payload, sails.config.session.secret);
return exits.success(token);
},
};