Skip to content

Commit

Permalink
Make diff smaller.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Mar 14, 2019
1 parent 7560043 commit 76fb7cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions lib/state/pkcesession.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,12 @@ PKCESessionStore.prototype.store = function(req, verifier, state, meta, callback
if (!req.session) { return callback(new Error('OAuth 2.0 authentication requires session support when using state. Did you forget to use express-session middleware?')); }

var key = this._key;
if (!req.session[key]) { req.session[key] = {}; }

var state = {
handle: uid(24),
verifier: verifier
};

if (!req.session[key]) { req.session[key] = {}; }
req.session[key].state = state;

callback(null, state.handle);
};

Expand Down
4 changes: 1 addition & 3 deletions lib/state/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ SessionStore.prototype.store = function(req, callback) {
if (!req.session) { return callback(new Error('OAuth 2.0 authentication requires session support when using state. Did you forget to use express-session middleware?')); }

var key = this._key;
if (!req.session[key]) { req.session[key] = {}; }

var state = uid(24);
if (!req.session[key]) { req.session[key] = {}; }
req.session[key].state = state;

callback(null, state);
};

Expand Down

0 comments on commit 76fb7cd

Please sign in to comment.