Skip to content

Commit

Permalink
Remove req._passport.session from remaining tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Sep 23, 2021
1 parent 7f41957 commit e20e3f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
8 changes: 0 additions & 8 deletions test/authenticator.middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ describe('Authenticator', function() {
expect(request._passport.instance).to.be.an.instanceOf(Authenticator);
expect(request._passport.instance).to.equal(passport);
});

it('should not expose session storage on internal request property', function() {
expect(request._passport.session).to.be.undefined;
});
});

describe('handling a request with custom user property', function() {
Expand Down Expand Up @@ -88,10 +84,6 @@ describe('Authenticator', function() {
expect(request._passport.instance).to.be.an.instanceOf(Authenticator);
expect(request._passport.instance).to.equal(passport);
});

it('should not expose session storage on internal request property', function() {
expect(request._passport.session).to.be.undefined;
});
});

});
Expand Down
23 changes: 14 additions & 9 deletions test/http/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ describe('http.ServerRequest', function() {
req.isUnauthenticated = request.isUnauthenticated;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
req.session = {};
req.session['passport'] = {};

var error;

Expand Down Expand Up @@ -72,7 +73,7 @@ describe('http.ServerRequest', function() {
});

it('should not serialize user', function() {
expect(req._passport.session.user).to.be.undefined;
expect(req.session['passport'].user).to.be.undefined;
});
});

Expand All @@ -86,7 +87,8 @@ describe('http.ServerRequest', function() {
req.isUnauthenticated = request.isUnauthenticated;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
req.session = {};
req.session['passport'] = {};

var error;

Expand Down Expand Up @@ -119,7 +121,7 @@ describe('http.ServerRequest', function() {
});

it('should not serialize user', function() {
expect(req._passport.session.user).to.be.undefined;
expect(req.session['passport'].user).to.be.undefined;
});
});

Expand All @@ -132,7 +134,8 @@ describe('http.ServerRequest', function() {
req.isUnauthenticated = request.isUnauthenticated;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
req.session = {};
req.session['passport'] = {};

var user = { id: '1', username: 'root' };
req.login(user, { session: false });
Expand All @@ -149,7 +152,7 @@ describe('http.ServerRequest', function() {
});

it('should not serialize user', function() {
expect(req._passport.session.user).to.be.undefined;
expect(req.session['passport'].user).to.be.undefined;
});
});

Expand Down Expand Up @@ -293,7 +296,8 @@ describe('http.ServerRequest', function() {
req.isUnauthenticated = request.isUnauthenticated;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
req.session = {};
req.session['passport'] = {};

var error;

Expand Down Expand Up @@ -321,7 +325,7 @@ describe('http.ServerRequest', function() {
});

it('should not serialize user', function() {
expect(req._passport.session.user).to.be.undefined;
expect(req.session['passport'].user).to.be.undefined;
});
});

Expand All @@ -347,7 +351,8 @@ describe('http.ServerRequest', function() {
req.login = request.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
req.session = {};
req.session['passport'] = {};

var user = { id: '1', username: 'root' };

Expand Down

0 comments on commit e20e3f9

Please sign in to comment.