digitalbazaar / forge

A native implementation of TLS in Javascript and tools to write crypto-based and network-heavy webapps
https://digitalbazaar.com/
Other
5.06k stars 779 forks source link

TypeError: Cannot read property 'search' of undefined #393

Closed az-ericso closed 7 years ago

az-ericso commented 8 years ago

I am getting this error message when trying to use the saml2-js and passport-saml libraries:

/xxxx/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/util.js:1320
          _queryVariables = parse(window.location.search.substring(1));
                                                 ^

TypeError: Cannot read property 'search' of undefined
    at Object.util.getQueryVariables (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/util.js:1320:50)
    at Array.initModule (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/log.js:306:26)
    at Array.module.exports (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/log.js:359:14)
    at Module.module.exports (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:42:14)
    at defineFunc (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:48:10)
    at /Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:86:14
    at define (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:15:7)
    at define (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:55:22)
    at /Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:60:1
    at Object.<anonymous> (/Users/kklh716/az/kancho/web/rubix-3.0/node_modules/saml2-js/node_modules/xml-encryption/node_modules/node-forge/js/forge.js:88:3)
dlongley commented 7 years ago

Addressed here: https://github.com/digitalbazaar/forge/blob/master/lib/util.js#L2304