Skip to content

Commit 10403ed

Browse files
committed
merge fix
1 parent cf37beb commit 10403ed

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

lib/strategies/webapp-strategy.js

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,6 @@ WebAppStrategy.logout = function (req) {
7474
req.logout();
7575
}
7676

77-
// legacy static version, does not log event to the auth server
78-
WebAppStrategy.logout = function (req) {
79-
finishLogout(req);
80-
};
81-
82-
// preferred non-static version, logs event to the auth server
83-
WebAppStrategy.prototype.logout = function (req) {
84-
logAction(req, this.serviceConfig.getOAuthServerUrl(), LOGOUT_ACTIVITY);
85-
finishLogout(req);
86-
};
87-
8877
WebAppStrategy.prototype.setPreferredLocale = function (req, language) {
8978

9079
// Check that express-session is enabled
@@ -493,47 +482,8 @@ function retrieveTokens(formData, strategy) {
493482
});
494483
}
495484
});
496-
497-
function addLocaleToQuery(req, url, strategy) {
498-
const localeToUse = strategy.getPreferredLocale(req);
499-
if (localeToUse) {
500-
url += "&" + LOCALE_PARAM_NAME + "=" + encodeURIComponent(localeToUse);
501-
} else {
502-
if (req && req.headers && req.headers['accept-language']) {
503-
let language = acceptLanguage.get(req.headers['accept-language']);
504-
url += "&" + LOCALE_PARAM_NAME + "=" + encodeURIComponent(language);
505-
}
506-
}
507-
return url;
485+
});
508486
}
509487

510-
function logAction(req, url, activity) {
511-
logger.debug("logAction");
512-
const loggingEndpoint = url + LOGGING_PATH;
513-
const appIdAuthContext = req.session[WebAppStrategy.AUTH_CONTEXT];
514-
if (!appIdAuthContext || !appIdAuthContext.accessToken || !appIdAuthContext.identityToken) {
515-
logger.debug("no session tokens found for logging activity " + activity );
516-
return;
517-
}
518-
519-
let requestData = {
520-
'eventName': activity,
521-
'id_token': appIdAuthContext.identityToken
522-
}
523-
524-
request({
525-
'method': "POST",
526-
'url': loggingEndpoint,
527-
'json': requestData,
528-
'auth': {
529-
'bearer': appIdAuthContext.accessToken
530-
}
531-
}, function (error, response, body){
532-
if (error) {
533-
logger.debug('logging request error: ' + error);
534-
} else {
535-
logger.debug('logging request ok: ' + response.statusCode);
536-
}});
537-
}
538488

539489
module.exports = WebAppStrategy;

0 commit comments

Comments
 (0)