Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small rework of verify hijack #1707

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions controllers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,25 @@ exports.callback = function (aReq, aRes, aNext) {
// Hijack the private verify method so we can mess stuff up freely
// We use this library for things it was never intended to do
if (openIdStrategies[strategy]) {
if (strategy === 'steam') {
strategyInstance._verify = function (aIgnore, aId, aDone) {
verifyPassport(aId, strategy, username, aReq.session.user, aDone);
};
} else {
strategyInstance._verify = function (aId, aDone) {
verifyPassport(aId, strategy, username, aReq.session.user, aDone);
};
switch(strategy) {
case 'steam':
strategyInstance._verify = function (aIgnore, aId, aDone) {
verifyPassport(aId, strategy, username, aReq.session.user, aDone);
};
break;
default:
strategyInstance._verify = function (aId, aDone) {
verifyPassport(aId, strategy, username, aReq.session.user, aDone);
};
}
} else {
strategyInstance._verify =
function (aToken, aRefreshOrSecretToken, aProfile, aDone) {
aReq.session.profile = aProfile;
verifyPassport(aProfile.id, strategy, username, aReq.session.user, aDone);
};
switch(strategy) {
default:
strategyInstance._verify = function (aToken, aRefreshOrSecretToken, aProfile, aDone) {
aReq.session.profile = aProfile;
verifyPassport(aProfile.id, strategy, username, aReq.session.user, aDone);
};
}
}

// This callback will happen after the verify routine
Expand Down