-
-
Save gajus/5bcd3c7ec5ddcaf53893 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authenticate = function (token, callback) { | |
var connection = mysql.createConnection(); | |
connection.connect(function () { | |
db.query('SELECT `id` FROM `user` WHERE `token` = ?', [token], function (err, rows) { | |
connection.end(); | |
callback(rows[0]); | |
}) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment