diff --git a/models/.index.js.swp b/models/.index.js.swp deleted file mode 100644 index 4dabc8a..0000000 Binary files a/models/.index.js.swp and /dev/null differ diff --git a/models/users.js b/models/users.js index fa59a7a..dd2f61a 100644 --- a/models/users.js +++ b/models/users.js @@ -6,6 +6,11 @@ module.exports = function(sequelize, DataTypes) { issuedDate: DataTypes.DATE // since tokens are one way only, we need to make sure the token is valid for today }, { classMethods: { + userToken: function (reqToken) { + User.find({ token: reqToken }, success: function (user) { + // validade issuedDate + } + } } });