Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #515 from stormpath/fix-registration-preloginhandler
Browse files Browse the repository at this point in the history
Fix OAuth login case when postRegistrationHandler is set but preLoginHandler is missing
  • Loading branch information
robertjd committed Nov 15, 2016
2 parents ec37d68 + 5d5a578 commit 52e9b18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/helpers/login-with-oauth-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ module.exports = function loginWithOAuthProvider(options, req, res) {
}

function continueWithHandlers(preHandler, postHandler, onCompleted) {
// If there's no preHandler, then provide a default one.
if (!preHandler) {
preHandler = function (options, req, res, callback) {
callback();
};
}

preHandler(options, req, res, function (err) {
if (err) {
return oauth.errorResponder(req, res, err);
Expand Down

0 comments on commit 52e9b18

Please sign in to comment.