mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-15 00:13:11 +02:00
Fixing PR
This commit is contained in:
@@ -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);
|
||||
@@ -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) {
|
||||
|
||||
@@ -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']
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user