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

Commit

Permalink
Fix tests & refactor SSL support
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Nov 4, 2014
1 parent b0d8b47 commit c931012
Show file tree
Hide file tree
Showing 30 changed files with 448 additions and 401 deletions.
21 changes: 4 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,23 @@ insert_final_newline = true
# Standard at: https://github.com/felixge/node-style-guide
[**.js, **.json]
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
max_line_length = 80
indent_style = tab
quote_type = single
curly_bracket_next_line = false
spaces_around_operators = true
space_after_control_statements = true
space_after_anonymous_functions = false
spaces_in_brackets = false

# https://github.com/jedmao/codepainter
[node_modules/**.js]
codepaint = false

# No Standard. Please document a standard if different from .js
[**.yml, **.html, **.css]
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
indent_style = tab

# No standard. Please document a standard if different from .js
[**.md]
indent_style = space

# Standard at:
[**.py]
indent_style = space
indent_size = 4
indent_style = tab

# Standard at:
[Makefile]
indent_style = tab
indent_size = 8
indent_style = tab
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ $
$ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean/public:/home/mean/public -v /Users/mdl/workspace/mean-stack/mean/app:/home/mean/app --link db:db_1 mean
```

## Running in a secure environment
To run your application in a secure manner you'll need to use OpenSSL and generate a set of self-signed certificates. Unix-based users can use the following commnad:
```
$ sh generate-ssl-certs.sh
```
Windows users can follow instructions found [here](http://www.websense.com/support/article/kbarticle/How-to-use-OpenSSL-and-Microsoft-Certification-Authority)
To generate the key and certificate and place them in the [config/sslcerts](config/sslcerts) folder.

## Getting Started With MEAN.JS
You have your application running but there are a lot of stuff to understand, we recommend you'll go over the [Official Documentation](http://meanjs.org/docs.html).
In the docs we'll try to explain both general concepts of MEAN components and give you some guidelines to help you improve your development process. We tried covering as many aspects as possible, and will keep update it by your request, you can also help us develop the documentation better by checking out the *gh-pages* branch of this repository.
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/errors.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var getUniqueErrorMessage = function(err) {
var fieldName = err.err.substring(err.err.lastIndexOf('.$') + 2, err.err.lastIndexOf('_1'));
output = fieldName.charAt(0).toUpperCase() + fieldName.slice(1) + ' already exists';

} catch(ex) {
} catch (ex) {
output = 'Unique field already exists';
}

Expand All @@ -22,7 +22,7 @@ var getUniqueErrorMessage = function(err) {
*/
exports.getErrorMessage = function(err) {
var message = '';

if (err.code) {
switch (err.code) {
case 11000:
Expand All @@ -39,4 +39,4 @@ exports.getErrorMessage = function(err) {
}

return message;
};
};
4 changes: 2 additions & 2 deletions app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ exports.reset = function(req, res, next) {
subject: 'Your password has been changed',
html: emailHTML
};

smtpTransport.sendMail(mailOptions, function(err) {
done(err, 'done');
});
Expand Down Expand Up @@ -242,4 +242,4 @@ exports.changePassword = function(req, res) {
message: 'User is not signed in'
});
}
};
};
6 changes: 3 additions & 3 deletions app/models/user.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ var UserSchema = new Schema({
resetPasswordToken: {
type: String
},
resetPasswordExpires: {
type: Date
}
resetPasswordExpires: {
type: Date
}
});

/**
Expand Down
4 changes: 2 additions & 2 deletions app/routes/users.server.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ module.exports = function(app) {
// Setting the linkedin oauth routes
app.route('/auth/linkedin').get(passport.authenticate('linkedin'));
app.route('/auth/linkedin/callback').get(users.oauthCallback('linkedin'));

// Setting the github oauth routes
app.route('/auth/github').get(passport.authenticate('github'));
app.route('/auth/github/callback').get(users.oauthCallback('github'));

// Finish by binding the user middleware
app.param('userId', users.userByID);
};
};
Loading

0 comments on commit c931012

Please sign in to comment.