Skip to content

Commit

Permalink
Fixed #20 premature redirect on logout due to mission optional callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rwky committed Jul 13, 2019
1 parent e056ba7 commit da353a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
This changelog follows Semantic Versioning https://semver.org/

# 3.0.1 (2019-07-13)

### Patch

* Fixed premature redirect in logOut #20 @rwky

# 3.0.0 (UNRELEASED)

### Major
Expand Down
5 changes: 3 additions & 2 deletions lib/http/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,19 @@ req.login = req.logIn;

/**
* Terminate an existing login session.
* @param {GenericCallback} done
* @returns {void}
* @public
*/
req.logOut = function logOut() {
req.logOut = function logOut(done) {
let property = 'user';
if (this._passport && this._passport.instance) {
property = this._passport.instance._userProperty || 'user';
}

this[property] = null;
if (this._passport) {
this._passport.instance._sm.logOut(this);
this._passport.instance._sm.logOut(this, done);
}
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@passport-next/passport",
"version": "3.0.0",
"version": "3.0.1",
"description": "Simple, unobtrusive authentication for Node.js.",
"author": {
"name": "Passport Next Developers",
Expand Down

0 comments on commit da353a8

Please sign in to comment.