diff options
Diffstat (limited to 'bucky/util')
| -rw-r--r-- | bucky/util/auth.js | 7 | ||||
| -rw-r--r-- | bucky/util/util.js | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/bucky/util/auth.js b/bucky/util/auth.js index 41cd155..32d77e8 100644 --- a/bucky/util/auth.js +++ b/bucky/util/auth.js @@ -82,13 +82,6 @@ var auth = module.exports = { }) }, - sanitizeUser: function (req_user) { - // sanitize user object - var user = JSON.parse(JSON.stringify(req_user)) - delete user.password - return user - }, - checkin: function (req, res) { var user = auth.sanitizeUser(req.user) res.json(user) diff --git a/bucky/util/util.js b/bucky/util/util.js index d4b6b8a..9e0f5a4 100644 --- a/bucky/util/util.js +++ b/bucky/util/util.js @@ -3,4 +3,11 @@ var util = module.exports = {} util.sanitizeName = function (s){ return (s || "").replace(new RegExp("[^-_a-zA-Z0-9]", 'g'), "") } util.sanitize = function (s){ return (s || "").replace(/<>&/g, "") } +util.sanitizeUser = function (req_user) { + // sanitize user object + var user = JSON.parse(JSON.stringify(req_user)) + delete user.password + return user +} + util.now = function(){ return Math.floor( (+ new Date()) / 1000 ) } |
