Skip to content

Instantly share code, notes, and snippets.

@arcseldon
Forked from robwormald/tokenAuth.js
Last active Aug 29, 2015
Embed
What would you like to do?
var jwt = require('jsonwebtoken')
var socketjwt = require('socketio-jwt')
module.exports.issueToken = function(payload){
var token = jwt.sign(payload,sails.config.session.secret)
return token;
}
module.exports.verifyToken = function(token,verified){
return jwt.verify(token,sails.config.session.secret,{},verified)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment