Skip to content

Commit

Permalink
- Linting (ESLint): Avoid "useless" catch error
Browse files Browse the repository at this point in the history
- Minor fixes for template files for gitignore/package.json/README
- npm: update devDeps
  • Loading branch information
brettz9 committed Jun 26, 2019
1 parent b3a5346 commit 2b8613e
Show file tree
Hide file tree
Showing 11 changed files with 639 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
},
extends: [
'@passport-next/eslint-config-passport-next/sauron-node.js',
// Override ash-nazg's current preference for ESM
// Override eslint-config-passport-next's current preference for ESM
'plugin:node/recommended-script'
],
settings: {
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = {
// Disable until ready to tackle
'require-jsdoc': 0,

// Disable current preferences of ash-nazg
// Disable current preferences of eslint-config-passport-next
'import/no-commonjs': 0,
'node/exports-style': 0,

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
reports/
docs/jsdoc
.github/docs/jsdoc
var/


Expand Down
1 change: 1 addition & 0 deletions lib/http/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const req = exports = module.exports = {};
* try {
* await req.logIn(user);
* } catch (err) {
* console.error(err);
* throw err;
* }
* // session saved
Expand Down
1 change: 1 addition & 0 deletions lib/middleware/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ module.exports = function authenticate(passport, name, options, callback) {
if (options.authInfo !== false) {
try {
const tinfo = await passport.transformAuthInfo(info, req);
// eslint-disable-next-line require-atomic-updates
req.authInfo = tinfo;
complete();
} catch (err) {
Expand Down
2 changes: 2 additions & 0 deletions lib/sessionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SessionManager {
}
return;
}
/* eslint-disable require-atomic-updates */
if (!req._passport.session) {
req._passport.session = {};
}
Expand All @@ -63,6 +64,7 @@ class SessionManager {
req.session = {};
}
req.session[this._key] = req._passport.session;
/* eslint-enable require-atomic-updates */
// eslint-disable-next-line no-unused-expressions
cb && cb();
}
Expand Down
1 change: 1 addition & 0 deletions lib/strategies/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class SessionStrategy extends Strategy {
} else {
// TODO: Remove instance access (set by `initialize`)
const property = req._passport.instance._userProperty || 'user';
// eslint-disable-next-line require-atomic-updates
req[property] = user;
}
this.pass();
Expand Down
Loading

0 comments on commit 2b8613e

Please sign in to comment.