projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2473f3f
)
Avoid trying to auth while waiting for auth to return.
author
Jason Skomorowski
<jason@indexdata.com>
Mon, 18 Aug 2014 19:22:30 +0000
(15:22 -0400)
committer
Jason Skomorowski
<jason@indexdata.com>
Mon, 18 Aug 2014 19:22:30 +0000
(15:22 -0400)
src/mkws-core.js
patch
|
blob
|
history
diff --git
a/src/mkws-core.js
b/src/mkws-core.js
index
6f58a92
..
3316f28
100644
(file)
--- a/
src/mkws-core.js
+++ b/
src/mkws-core.js
@@
-14,6
+14,7
@@
window.mkws = {
$: $, // Our own local copy of the jQuery object
authenticated: false,
window.mkws = {
$: $, // Our own local copy of the jQuery object
authenticated: false,
+ authenticating: false,
active: false,
log_level: 1, // Will be overridden from mkws.config, but
// initial value allows jQuery popup to use logging.
active: false,
log_level: 1, // Will be overridden from mkws.config, but
// initial value allows jQuery popup to use logging.
@@
-445,6
+446,7
@@
mkws.pagerNext = function(tname) {
* for the site.
*/
function authenticateSession(auth_url, auth_domain, pp2_url) {
* for the site.
*/
function authenticateSession(auth_url, auth_domain, pp2_url) {
+ mkws.authenticating = true;
log("service proxy authentication on URL: " + auth_url);
if (!auth_domain) {
log("service proxy authentication on URL: " + auth_url);
if (!auth_domain) {
@@
-458,6
+460,7
@@
mkws.pagerNext = function(tname) {
}, auth_domain);
request.get(null, function(data) {
}, auth_domain);
request.get(null, function(data) {
+ mkws.authenticating = false;
if (!$.isXMLDoc(data)) {
alert("Service Proxy authentication response is not a valid XML document");
return;
if (!$.isXMLDoc(data)) {
alert("Service Proxy authentication response is not a valid XML document");
return;
@@
-650,11
+653,11
@@
mkws.pagerNext = function(tname) {
}
*/
}
*/
- if (mkws.config.use_service_proxy && !mkws.authenticated) {
+ if (mkws.config.use_service_proxy && !mkws.authenticated && !mkws.authenticating) {
authenticateSession(mkws.config.service_proxy_auth,
mkws.config.service_proxy_auth_domain,
mkws.config.pazpar2_url);
authenticateSession(mkws.config.service_proxy_auth,
mkws.config.service_proxy_auth_domain,
mkws.config.pazpar2_url);
- } else {
+ } else if (!mkws.authenticating) {
// raw pp2 or we have a session already open
runAutoSearches();
}
// raw pp2 or we have a session already open
runAutoSearches();
}