Skip to content

Commit bb640c7

Browse files
committed
Fixed console.log leak of User password (left-overs from testing...).
1 parent 7e0fae3 commit bb640c7

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

.idea/runConfigurations/Run_Tests.xml

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mocharc.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
bail: false #stop on first error
2-
async-only: true
2+
async-only: true # require use of "done" cb or an async function (a Promise)
33
require:
44
- 'test/hooks.js'
55
spec: 'test/**/*.test.js'
6-
timeout: 5000
6+
timeout: 5000 # Give Sails some breathing room... We are building schemas / data fixtures.
7+
checkLeaks: true
8+
global:
9+
- '_'
10+
- 'sails'
11+
- '__core-js_shared__'
12+
- 'Archive' # Sails' built-in archive
13+
- 'User'
14+
- 'Session'
15+
- 'RequestLog'
16+
- 'Log'

api/models/User.js

-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ module.exports = {
132132
beforeCreate: async function(user, next) {
133133
const email = user.email.toLowerCase().trim();
134134

135-
console.log(user.password);
136-
137135
user.email = email;
138136
user.avatar = 'https://www.gravatar.com/avatar/' + md5(email);
139137
user.firstName = user.firstName.trim().charAt(0).toUpperCase() + user.firstName.slice(1).trim();

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sails-react-bootstrap-webpack",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "An opinionated base configuration of Sails, with Webpack for React support, and Bootstrap for styling.",
55
"keywords": [
66
"sails",

test/hooks.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
*/
55

66
const _ = require('lodash');
7-
global.should = require('chai').should();
7+
const chai = require('chai');
8+
global.should = chai.should();
89

910
const Sails = require('sails');
1011
const Fixted = require('fixted');
@@ -53,7 +54,7 @@ exports.mochaHooks = {
5354
// Load fixtures
5455
const fixted = new Fixted();
5556

56-
// Populate the DB, forcing creation of accounts and users first
57+
// Populate the DB, forcing creation of users first
5758
fixted.populate([
5859
'user'
5960
], done);
@@ -64,6 +65,5 @@ exports.mochaHooks = {
6465
// here you can clear fixtures, etc.
6566
console.log(); // skip a line before lowering logs
6667
sails.lower(done);
67-
// done();
6868
}
6969
};

0 commit comments

Comments
 (0)