login-plus 1.9.0-beta.1 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,6 @@ login service for express
5
5
  [![downloads](https://img.shields.io/npm/dm/login-plus.svg)](https://npmjs.org/package/login-plus)
6
6
  [![build](https://github.com/codenautas/login-plus/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/codenautas/login-plus/actions/workflows/build-and-test.yml)
7
7
  [![coverage](https://img.shields.io/coveralls/codenautas/login-plus/master.svg)](https://coveralls.io/r/codenautas/login-plus)
8
- [![security](https://socket.dev/api/badge/npm/package/login-plus)](https://socket.dev/npm/package/login-plus)
9
8
  [![qa-control](https://github.com/codenautas/login-plus/actions/workflows/qa-control.yml/badge.svg)](https://github.com/codenautas/login-plus/actions/workflows/qa-control.yml)
10
9
 
11
10
 
@@ -15,7 +15,7 @@ window.addEventListener('load',function(){
15
15
  elem.value=params[parameterName];
16
16
  }
17
17
  });
18
- if(params['a']==1){
18
+ if (params['a'] == 1) { /* eslint-disable-line eqeqeq */
19
19
  loginForm.submit();
20
20
  }
21
21
  });
package/lib/login-plus.js CHANGED
@@ -180,7 +180,7 @@ function checkAlreadyLoggedIn(app, opts){
180
180
  });
181
181
  }
182
182
 
183
- loginPlus.Manager.prototype.init = function init(app,opts){ // eslint-disable-line complexity
183
+ loginPlus.Manager.prototype.init = function init(app,opts){ // eslint-disable-line max-statements
184
184
  var thisManager = this;
185
185
  if(!this.passport){
186
186
  var router = '_router' in app ? app._router : app.router;
@@ -269,10 +269,13 @@ loginPlus.Manager.prototype.init = function init(app,opts){ // eslint-disable-li
269
269
  app.use(opts.baseUrl,this.ensureMiddleware);
270
270
  //// NOW is logged in
271
271
  app.post(opts.baseUrl+opts.chPassUrlPath, function(req,res){
272
- if(req.body.newPassword!=req.body.repPassword){
272
+ if (!req.body.newPassword) {
273
+ req.flash('error', (opts.messages?.passCantBeEmpty || "new pass cant be empty"));
274
+ res.redirect(opts.redirBaseUrl+opts.chPassUrlPath)
275
+ }else if (req.body.newPassword !== req.body.repPassword) {
273
276
  req.flash('error', (opts.messages?.passDoesntMatch || "new pass doesn't match"));
274
277
  res.redirect(opts.redirBaseUrl+opts.chPassUrlPath);
275
- }else if(req.body.newPassword.length>=opts.passMinLength){
278
+ }else if((req.body.newPassword||'').length>=opts.passMinLength){
276
279
  thisManager.passwordChanger(
277
280
  req,
278
281
  req.user[opts.userFieldName],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "login-plus",
3
3
  "description": "login service for express",
4
- "version": "1.9.0-beta.1",
4
+ "version": "1.9.1",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/login-plus",
@@ -23,39 +23,42 @@
23
23
  "overrides": {
24
24
  "diff": ">=8.0.2",
25
25
  "serialize-javascript": ">=7.0.0",
26
+ "stylus": {
27
+ "glob": "^11"
28
+ },
26
29
  "uuid": ">=14.0.0"
27
30
  },
28
31
  "dependencies": {
29
- "best-globals": "^2.2.2",
32
+ "best-globals": "^2.2.3",
30
33
  "connect-flash": "^0.1.1",
31
- "ensure-login": "0.1.6-beta.1",
34
+ "ensure-login": "^0.1.6",
32
35
  "express-session": "^1.19.0",
33
- "fs-extra": "^11.3.6",
34
- "mini-tools": "^1.13.7",
36
+ "fs-extra": "^11.4.1",
37
+ "mini-tools": "^1.13.11",
35
38
  "passport": "^0.7.0",
36
39
  "passport-local": "^1.0.0",
37
40
  "regexplicit": "^0.1.3",
38
41
  "session-file-store": "^1.5.0"
39
42
  },
40
43
  "devDependencies": {
41
- "ajax-best-promise": "^0.4.3",
44
+ "ajax-best-promise": "^0.4.5",
42
45
  "body-parser": "^2.3.0",
43
46
  "concat-stream": "^2.0.0",
44
47
  "cookie-parser": "^1.4.7",
45
48
  "expect.js": "^0.3.1",
46
- "express": "^5.2.1",
47
- "mocha": "^11.7.6",
49
+ "express": "^5.3.0",
50
+ "mocha": "^12.0.3",
48
51
  "nyc": "^18.0.0",
49
- "pg-promise-strict": "^1.4.6",
52
+ "pg-promise-strict": "^1.5.0",
50
53
  "php-session": "^0.1.0",
51
54
  "pug": "^3.0.4",
52
- "qa-control": "^0.7.5",
55
+ "qa-control": "^0.12.2",
53
56
  "read-yaml-promise": "^1.0.2",
54
57
  "self-explain": "^0.11.0",
55
- "serve-content": "^1.0.5",
56
- "sinon": "^22.0.0",
58
+ "serve-content": "^1.0.6",
59
+ "sinon": "^22.1.0",
57
60
  "stylus": "^0.64.0",
58
- "supertest": "^7.2.2"
61
+ "supertest": "^7.3.1"
59
62
  },
60
63
  "optionalDependencies": {
61
64
  "php-session": "^0.1.0"
@@ -65,8 +68,7 @@
65
68
  },
66
69
  "scripts": {
67
70
  "test": "mocha --reporter spec --bail --check-leaks --globals __core-js_shared__ --exit test/test*.js",
68
- "test-ci": "nyc node_modules/mocha/bin/_mocha --report lcovonly --exit --check-leaks --globals __core-js_shared__ test/",
69
- "test-cov": "nyc mocha --exit test/test*.js && nyc report --reporter=lcov",
71
+ "test-ci": "nyc mocha --exit test/test*.js --exit --check-leaks --globals __core-js_shared__ && nyc report --reporter=lcov",
70
72
  "start": "node example/server.js"
71
73
  },
72
74
  "nyc": {
@@ -76,10 +78,8 @@
76
78
  "branches": 98
77
79
  },
78
80
  "qa-control": {
79
- "package-version": "0.3.0",
80
81
  "run-in": "server",
81
82
  "type": "lib",
82
- "stage": "stable",
83
83
  "coverage": 100,
84
84
  "gha": "all"
85
85
  }