Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Fixing PR
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Oct 23, 2013
1 parent 6dbe996 commit 4dd90f1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
19 changes: 10 additions & 9 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
Expand Down Expand Up @@ -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);
},


Expand All @@ -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);
5 changes: 4 additions & 1 deletion config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 1 addition & 5 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"mongoose": "latest",
"connect-mongo": "latest",
"connect-flash": "latest",
"scrypt": "latest",
"passport": "latest",
"passport-local": "latest",
"passport-facebook": "latest",
Expand All @@ -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",
Expand Down

0 comments on commit 4dd90f1

Please sign in to comment.