From 7b94a1edbe6a1b28159c05ab9caf5fff2c8b32d4 Mon Sep 17 00:00:00 2001 From: tomtom215 Date: Mon, 13 Mar 2017 23:45:10 -0400 Subject: [PATCH] Remove "node-uuid" dependency for salt Remove external dependency of outdated "node-uuid" for salting and using vanilla Node Crypto instead via shaking this salt function instead: return crypto.randomBytes(20).toString('hex'); --- .../server/api/auth/auth.controller.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/image-editor-ui/image-editor-ui-angular-express-hi-res/server/api/auth/auth.controller.js b/image-editor-ui/image-editor-ui-angular-express-hi-res/server/api/auth/auth.controller.js index 6a82d9c..4dc7e9c 100644 --- a/image-editor-ui/image-editor-ui-angular-express-hi-res/server/api/auth/auth.controller.js +++ b/image-editor-ui/image-editor-ui-angular-express-hi-res/server/api/auth/auth.controller.js @@ -1,5 +1,5 @@ var http = require('http'); -var uuid = require('node-uuid'); +//var uuid = require('node-uuid'); var crypto = require('crypto'); var apiKeys = require('../../apiKeys.js'); @@ -29,7 +29,8 @@ function getAuthObj() { } function getSalt() { - return uuid.v4(); + //return uuid.v4(); + return crypto.randomBytes(20).toString('hex'); } function getUnixTimestamp() { @@ -41,4 +42,4 @@ function getSignature(key, secret, timestamp, salt, encryptionMethod) { let sig = key + secret + timestamp + salt; return crypto.createHash(encryptionMethod).update(sig).digest('hex'); -} \ No newline at end of file +}