From ce73133c4e982db99f218bf930d82eb991ce81e3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 11 Dec 2017 11:17:55 +0100 Subject: profile --- bucky/util/auth.js | 7 ------- bucky/util/util.js | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'bucky/util') 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 ) } -- cgit v1.2.3-70-g09d2