Skip to content

Instantly share code, notes, and snippets.

Forked from robwormald/tokenAuth.js
Last active August 29, 2015 14:06
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