Browse Source

function to get the token, checking if it is valid (which I still need to think about)

master
Julio Biason 11 years ago
parent
commit
98ac06bdd2
  1. BIN
      models/.index.js.swp
  2. 5
      models/users.js

BIN
models/.index.js.swp

Binary file not shown.

5
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 issuedDate: DataTypes.DATE // since tokens are one way only, we need to make sure the token is valid for today
}, { }, {
classMethods: { classMethods: {
userToken: function (reqToken) {
User.find({ token: reqToken }, success: function (user) {
// validade issuedDate
}
}
} }
}); });

Loading…
Cancel
Save