Skip to content

Commit

Permalink
npm: Update passport
Browse files Browse the repository at this point in the history
Using promisification since the logout function is async now:
jaredhanson/passport#929
  • Loading branch information
jtojnar committed Sep 1, 2022
1 parent 888f620 commit 1ec0263
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import express from 'express';
import path from 'path';
import url from 'url';
import * as db from './db.js';
import pify from 'pify';

import passport from 'passport';
import PassportLocal from 'passport-local';
Expand Down Expand Up @@ -585,8 +586,8 @@ router.post('/login', passport.authenticate('local', {successRedirect: '/', fail
return res.render('login', {identity: req.user, values: req.body});
});

router.get('/logout', function(req, res) {
req.logout();
router.get('/logout', async function(req, res) {
await pify(req.logout.bind(req))();
res.redirect('/');
});

Expand Down
41 changes: 32 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"moment": "^2.24.0",
"morgan": "^1.9.1",
"neat-csv": "^7.0.0",
"passport": "^0.4.0",
"passport": "^0.6.0",
"passport-local": "^1.0.0",
"pg": "^8.4.0",
"pify": "^6.0.0",
"sanitizer": "^0.1.3",
"serve-favicon": "^2.5.0",
"serve-static": "^1.14.1",
Expand Down

0 comments on commit 1ec0263

Please sign in to comment.