From 4dd90f1e69b96d766faec38f516e32c8085f4560 Mon Sep 17 00:00:00 2001 From: Amos Haviv Date: Wed, 23 Oct 2013 12:23:04 +0300 Subject: [PATCH] Fixing PR --- app/models/user.js | 19 ++++++++++--------- config/express.js | 5 ++++- gruntfile.js | 6 +----- package.json | 9 ++------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/app/models/user.js b/app/models/user.js index d726835960..83896ea3b8 100755 --- a/app/models/user.js +++ b/app/models/user.js @@ -3,19 +3,20 @@ */ var mongoose = require('mongoose'), Schema = mongoose.Schema, - crypto = require('crypto'), scrypt = require('scrypt'), _ = require('underscore'), authTypes = ['github', 'twitter', 'facebook', 'google']; - - + /** * User Schema */ var UserSchema = new Schema({ name: String, email: String, - username: {type: String, unique: true}, + username: { + type: String, + unique: true + }, provider: String, hashed_password: String, facebook: {}, @@ -91,7 +92,7 @@ UserSchema.methods = { * @api public */ authenticate: function(plainText) { - return scrypt.verifyHashSync(this.hashed_password, plainText); + return scrypt.verifyHashSync(this.hashed_password, plainText); }, @@ -104,10 +105,10 @@ UserSchema.methods = { */ encryptPassword: function(password) { if (!password) return ''; - var maxtime = 0.1; - return scrypt.passwordHashSync(password, maxtime); - //return crypto.createHmac('sha1', this.salt).update(password).digest('hex'); + + var maximumTimeout = 0.1; + return scrypt.passwordHashSync(password, maximumTimeout); } }; -mongoose.model('User', UserSchema); +mongoose.model('User', UserSchema); \ No newline at end of file diff --git a/config/express.js b/config/express.js index dc72f4c981..9a81a7e2b9 100755 --- a/config/express.js +++ b/config/express.js @@ -8,8 +8,11 @@ var express = require('express'), config = require('./config'); module.exports = function(app, passport, db) { - app.set('showStackError', true); + app.set('showStackError', true); + + //Prettify HTML app.locals.pretty = true; + //Should be placed before express.static app.use(express.compress({ filter: function(req, res) { diff --git a/gruntfile.js b/gruntfile.js index b2f9712e64..2c41e8d626 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -27,11 +27,7 @@ module.exports = function(grunt) { options: { livereload: true } - }, - test: { - files: '*', - tasks: ['test'] - } + } }, jshint: { all: ['gruntfile.js', 'public/js/**/*.js', 'test/**/*.js', 'app/**/*.js'] diff --git a/package.json b/package.json index dcde034bed..e8256bb6b0 100755 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "mongoose": "latest", "connect-mongo": "latest", "connect-flash": "latest", + "scrypt": "latest", "passport": "latest", "passport-local": "latest", "passport-facebook": "latest", @@ -36,14 +37,8 @@ "forever": "latest", "bower": "latest", "grunt": "latest", -<<<<<<< HEAD - "grunt-cli": "latest" -======= "grunt-cli": "latest", - "grunt-env": "latest", - "grunt-bower-task": "latest", - "scrypt": "latest" ->>>>>>> 71365db8398cfc2c1d40aceef4cb25927109eb10 + "grunt-env": "latest" }, "devDependencies": { "supertest": "latest",