Instead of saving authName in the mkws structure, publish it to the
authorMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 17:42:33 +0000 (17:42 +0000)
committerMike Taylor <mike@indexdata.com>
Wed, 26 Mar 2014 17:42:33 +0000 (17:42 +0000)
"authenticated" queue of each team.

src/mkws-core.js

index 668b44a..a485f34 100644 (file)
@@ -11,7 +11,6 @@
 //
 var mkws = {
     authenticated: false,
-    authName: undefined,
     log_level: 1, // Will be overridden from mkws_config, but
                   // initial value allows jQuery popup to use logging.
     teams: {},
@@ -295,7 +294,11 @@ if (mkws_config == null || typeof mkws_config != 'object') {
 
            log("Service proxy auth successfully done");
            mkws.authenticated = true;
-           mkws.authName = $(data).find("displayName").text();
+           var authName = $(data).find("displayName").text();
+           for (var teamName in mkws.teams) {
+               mkws.teams[teamName].queue("authenticated").publish(authName);
+           }
+
            runAutoSearches();
        });
     }