Fixing PR

This commit is contained in:
Amos Haviv
2013-10-23 12:23:04 +03:00
parent 6dbe99653d
commit 4dd90f1e69
4 changed files with 17 additions and 22 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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']

View File

@@ -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",