[js-embedded-discovery] branch master updated: EDS-83 Do not throw a popup if the whitelisting fails

Rod Widdowson rdw at steadingsoftware.com
Sun Jan 27 08:11:15 EST 2019


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository js-embedded-discovery.

View the commit online:
http://git.shibboleth.net/view/?p=js-embedded-discovery.git;a=commit;h=9321f03f62a4b7499817ec80177b0eee8deeb5f7

The following commit(s) were added to refs/heads/master by this push:
       new  9321f03   EDS-83 Do not throw a popup if the whitelisting fails
9321f03 is described below

commit 9321f03f62a4b7499817ec80177b0eee8deeb5f7
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Jan 27 13:10:03 2019 +0000

    EDS-83 Do not throw a popup if the whitelisting fails
    
    https://issues.shibboleth.net/jira/browse/EDS-83
    
    This requires fixing a chicken and egg problem to do with
    reporting errors to the screen as well as the popup
---
 src/javascript/idpselect.js | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index eb2b5cc..08a546c 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -78,11 +78,16 @@ function IdPSelectUI() {
     */
     this.draw = function(parms){
 
+        //
+        // try to set up the div first so that errors from setUpLocals
+        // will go to the screen.
+        //
+        idpSelectDiv = document.getElementById(parms.insertAtDiv);
+
         if (!setupLocals(parms)) {
             return;
         }
 
-        idpSelectDiv = document.getElementById(parms.insertAtDiv);
         if(!idpSelectDiv){
             fatal(getLocalizedMessage('fatal.divMissing'));
             return;
@@ -338,7 +343,8 @@ function IdPSelectUI() {
             return false;
         }
         if (!validateReturn(paramsSupplied.returnWhiteList, returnString)) {
-            fatal(getLocalizedMessage('fatal.badReturnString'));
+
+            fatalNoAlert(getLocalizedMessage('fatal.badReturnString'));
             return false;
         }
 
@@ -1586,14 +1592,21 @@ function IdPSelectUI() {
     //                  exbedding into log4js
     //
     // *************************************
-    /**
-       
-    */
+
+    var fatalNoAlert = function(message) {
+        if (idpSelectDiv) {
+            var txt = document.createTextNode(message);
+            idpSelectDiv.appendChild(txt);
+        } else {
+            alert('FATAL (NoDiv):' + message);
+        }
+    };
 
     var fatal = function(message) {
         alert('FATAL - DISCO UI:' + message);
-        var txt = document.createTextNode(message); 
-        idpSelectDiv.appendChild(txt);
+        if (idpSelectDiv) {
+            fatalNoAlert(message);
+        }
     };
 
     var debug = function() {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list