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/util.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bucky/util/util.js') 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