From 13553ba03c2e5c1d33aaf28123702d5149b051c7 Mon Sep 17 00:00:00 2001 From: Cesar Vargas Date: Wed, 10 Sep 2014 01:06:47 -0300 Subject: [PATCH 1/6] refactor(app:templates:server): deprecate res.sendfile -- use res.sendFile instead --- app/templates/server/routes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/templates/server/routes.js b/app/templates/server/routes.js index c2b5acb2e..ebcd79dc6 100644 --- a/app/templates/server/routes.js +++ b/app/templates/server/routes.js @@ -5,6 +5,7 @@ 'use strict'; var errors = require('./components/errors'); +var path = require('path'); module.exports = function(app) { @@ -21,6 +22,6 @@ module.exports = function(app) { // All other routes should redirect to the index.html app.route('/*') .get(function(req, res) { - res.sendfile(app.get('appPath') + '/index.html'); + res.sendFile(path.resolve(app.get('appPath') + '/index.html')); }); }; From a9230ca2ba1b2727abdc466a11096ec513fd7085 Mon Sep 17 00:00:00 2001 From: Paolo Sinelli Date: Thu, 11 Sep 2014 17:02:15 +0100 Subject: [PATCH 2/6] feat(gen): Remove global jQuery dependency Close #547 --- app/templates/_bower.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/templates/_bower.json b/app/templates/_bower.json index 1681050a2..ce22650fb 100644 --- a/app/templates/_bower.json +++ b/app/templates/_bower.json @@ -4,8 +4,7 @@ "dependencies": { "angular": ">=1.2.*", "json3": "~3.3.1", - "es5-shim": "~3.0.1", - "jquery": "~1.11.0",<% if(filters.bootstrap) { %><% if (filters.sass) { %> + "es5-shim": "~3.0.1",<% if(filters.bootstrap) { %><% if (filters.sass) { %> "bootstrap-sass-official": "~3.1.1",<% } %> "bootstrap": "~3.1.1",<% } %> "angular-resource": ">=1.2.*", From e42b7fd0bedd8538b17e85963af61b13860b94a2 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 11 Sep 2014 23:38:40 -0600 Subject: [PATCH 3/6] Minor typo fix in using generator instructions --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index da6a851d1..5ccfc22c7 100644 --- a/readme.md +++ b/readme.md @@ -198,7 +198,7 @@ Produces: client/app/myService/myService.service.spec.js -You can also do `yo angular:factory` and `yo angular:provider` for other types of services. +You can also do `yo angular-fullstack:factory` and `yo angular-fullstack:provider` for other types of services. ### Decorator Generates an AngularJS service decorator. From b0ce36e263634582356c3bfe9646127990b1d3eb Mon Sep 17 00:00:00 2001 From: Tyler Henkel Date: Sat, 13 Sep 2014 14:54:29 -0600 Subject: [PATCH 4/6] use grunt injector instead of fork --- app/templates/Gruntfile.js | 1 - app/templates/_package.json | 2 +- test/fixtures/package.json | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/templates/Gruntfile.js b/app/templates/Gruntfile.js index 998ca5620..a0267aaa4 100644 --- a/app/templates/Gruntfile.js +++ b/app/templates/Gruntfile.js @@ -16,7 +16,6 @@ module.exports = function (grunt) { ngtemplates: 'grunt-angular-templates', cdnify: 'grunt-google-cdn', protractor: 'grunt-protractor-runner', - injector: 'grunt-asset-injector', buildcontrol: 'grunt-build-control' }); diff --git a/app/templates/_package.json b/app/templates/_package.json index e32849740..a12359e8c 100644 --- a/app/templates/_package.json +++ b/app/templates/_package.json @@ -58,7 +58,7 @@ "grunt-angular-templates": "^0.5.4", "grunt-dom-munger": "^3.4.0", "grunt-protractor-runner": "^1.1.0", - "grunt-asset-injector": "^0.1.0", + "grunt-injector": "~0.5.4", "grunt-karma": "~0.8.2", "grunt-build-control": "DaftMonk/grunt-build-control", "grunt-mocha-test": "~0.10.2",<% if(filters.sass) { %> diff --git a/test/fixtures/package.json b/test/fixtures/package.json index ce4df22f9..856e4fcc2 100644 --- a/test/fixtures/package.json +++ b/test/fixtures/package.json @@ -58,7 +58,7 @@ "grunt-angular-templates": "^0.5.4", "grunt-dom-munger": "^3.4.0", "grunt-protractor-runner": "^1.1.0", - "grunt-asset-injector": "^0.1.0", + "grunt-injector": "~0.5.4", "grunt-karma": "~0.8.2", "grunt-build-control": "DaftMonk/grunt-build-control", "grunt-mocha-test": "~0.10.2", From a025920e53a7d34c39a164e6c551d8d0cf426041 Mon Sep 17 00:00:00 2001 From: Jason Kurian Date: Wed, 1 Oct 2014 00:27:59 -0400 Subject: [PATCH 5/6] chore(gen): Add gitter.im badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 5ccfc22c7..31836c2a2 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# AngularJS Full-Stack generator [![Build Status](https://travis-ci.org/DaftMonk/generator-angular-fullstack.svg?branch=master)](http://travis-ci.org/DaftMonk/generator-angular-fullstack) +# AngularJS Full-Stack generator [![Build Status](https://travis-ci.org/DaftMonk/generator-angular-fullstack.svg?branch=master)](http://travis-ci.org/DaftMonk/generator-angular-fullstack) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/DaftMonk/generator-angular-fullstack) > Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node - lets you quickly set up a project following best practices. From 89980c5c6a97cd518294c7ce9d2144c3ad559785 Mon Sep 17 00:00:00 2001 From: Harry Budianto Date: Fri, 3 Oct 2014 08:26:48 +0700 Subject: [PATCH 6/6] Fix issue #569 --- .../server/api/user(auth)/user.controller.js | 2 +- .../server/api/user(auth)/user.model.js | 4 ++-- .../server/api/user(auth)/user.model.spec.js | 20 +++++++++++++++++++ .../server/auth(auth)/local/passport.js | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/templates/server/api/user(auth)/user.controller.js b/app/templates/server/api/user(auth)/user.controller.js index f4cd10c29..ee3d56387 100644 --- a/app/templates/server/api/user(auth)/user.controller.js +++ b/app/templates/server/api/user(auth)/user.controller.js @@ -86,7 +86,7 @@ exports.me = function(req, res, next) { var userId = req.user._id; User.findOne({ _id: userId - }, '-salt -hashedPassword', function(err, user) { // don't ever give out the password or salt + }, function(err, user) { // don't ever give out the password or salt if (err) return next(err); if (!user) return res.json(401); res.json(user); diff --git a/app/templates/server/api/user(auth)/user.model.js b/app/templates/server/api/user(auth)/user.model.js index cc8d59263..ef51ba493 100644 --- a/app/templates/server/api/user(auth)/user.model.js +++ b/app/templates/server/api/user(auth)/user.model.js @@ -12,9 +12,9 @@ var UserSchema = new Schema({ type: String, default: 'user' }, - hashedPassword: String, + hashedPassword: {type: String, select: false}, provider: String, - salt: String<% if (filters.oauth) { %>,<% if (filters.facebookAuth) { %> + salt: {type: String, select: false}<% if (filters.oauth) { %>,<% if (filters.facebookAuth) { %> facebook: {},<% } %><% if (filters.twitterAuth) { %> twitter: {},<% } %><% if (filters.googleAuth) { %> google: {},<% } %> diff --git a/app/templates/server/api/user(auth)/user.model.spec.js b/app/templates/server/api/user(auth)/user.model.spec.js index 257c95b7c..f8bd4caa0 100644 --- a/app/templates/server/api/user(auth)/user.model.spec.js +++ b/app/templates/server/api/user(auth)/user.model.spec.js @@ -50,6 +50,26 @@ describe('User Model', function() { }); }); + it('should not have salt by default', function(done) { + user.save(function() { + }); + + User.find({name: user.name}, function(err, _user) { + _user.should.not.have.property('salt'); + done(); + }); + }); + + it('should not have hashedPassword by default', function(done) { + user.save(function() { + }); + + User.find({name: user.name}, function(err, _user) { + _user.should.not.have.property('hashedPassword'); + done(); + }); + }); + it("should authenticate user if password is valid", function() { return user.authenticate('password').should.be.true; }); diff --git a/app/templates/server/auth(auth)/local/passport.js b/app/templates/server/auth(auth)/local/passport.js index ac82b42a2..8b06ed462 100644 --- a/app/templates/server/auth(auth)/local/passport.js +++ b/app/templates/server/auth(auth)/local/passport.js @@ -9,7 +9,7 @@ exports.setup = function (User, config) { function(email, password, done) { User.findOne({ email: email.toLowerCase() - }, function(err, user) { + }, '+salt +hashedPassword', function(err, user) { if (err) return done(err); if (!user) {