@@ -74,17 +74,6 @@ WebAppStrategy.logout = function (req) {
74
74
req . logout ( ) ;
75
75
}
76
76
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
-
88
77
WebAppStrategy . prototype . setPreferredLocale = function ( req , language ) {
89
78
90
79
// Check that express-session is enabled
@@ -493,47 +482,8 @@ function retrieveTokens(formData, strategy) {
493
482
} ) ;
494
483
}
495
484
} ) ;
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
+ } ) ;
508
486
}
509
487
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
- }
538
488
539
489
module . exports = WebAppStrategy ;
0 commit comments