auth header happy in xul now
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Aug 2006 15:58:12 +0000 (15:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 20 Aug 2006 15:58:12 +0000 (15:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5609 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/RemoteRequest.js

index 9ee7295..d532691 100644 (file)
@@ -258,22 +258,11 @@ RemoteRequest.prototype.send = function(blocking) {
        }
 
        try {
-               var ses;
-
-               try { ses = cookieManager.read(COOKIE_SES) } catch(ee) {}
-
-               if( !ses && isXUL() ) {
-                       /*
-                       JSAN.use('OpenILS.data'); 
-                       var data = new OpenILS.data(); 
-                       data.init({'via':'stash'});
-                       ses = data.session.key;
-                       dump('Setting authtoken header: ' + ses + ' : ' + url + '\n');
-                       */
-               } 
-
-               if( ses ) 
-                       this.xmlhttp.setRequestHeader('X-OILS-Authtoken', ses);
+               var auth;
+               try { auth = cookieManager.read(COOKIE_SES) } catch(ee) {}
+               if( !auth && isXUL() ) auth = ses();
+               if( auth ) 
+                       this.xmlhttp.setRequestHeader('X-OILS-Authtoken', auth);
 
        } catch(e) {}