Skip to content

Instantly share code, notes, and snippets.

@sean3z
Last active May 30, 2018 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean3z/81eaf27b7f3de3127fa75a87433947de to your computer and use it in GitHub Desktop.
Save sean3z/81eaf27b7f3de3127fa75a87433947de to your computer and use it in GitHub Desktop.
Restify JWT example
"use strict";
exports.authenticate = (username, password) => {
return Promise.resolve({ uid: 1, name: 'Sean', admin: false });
};
/*
exports.authenticate = (username, password) => {
return new Promise((resolve, reject) => {
db.findOne({username, password}, (err, data) => {
if (err) return reject(err);
resolve(data); // {uid: 1, name: Sean, admin: false}
});
});
};
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment