Commit 94efc950 authored by Bram Driesen's avatar Bram Driesen Committed by Bram Driesen
Browse files

Issue #3297477 by Project Update Bot, BramDriesen: Automated Drupal 10 compatibility fixes

parent db939353
Loading
Loading
Loading
Loading
+19 −22
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * @link http://www.keycloak.org/docs/3.1/securing_apps/topics/oidc/javascript-adapter.html
 */

(function ($, Drupal, drupalSettings) {
(function (Drupal, $, once, drupalSettings) {
  'use strict';

  /**
@@ -97,8 +97,7 @@
            success: function (callback) {
              if (p.success) {
                callback(p.result);
              }
              else if (!p.error) {
              } else if (!p.error) {
                p.successCallback = callback;
              }
              return p.promise;
@@ -106,8 +105,7 @@
            error: function (callback) {
              if (p.error) {
                callback(p.result);
              }
              else if (!p.success) {
              } else if (!p.success) {
                p.errorCallback = callback;
              }
              return p.promise;
@@ -127,8 +125,7 @@
      function getOrigin() {
        if (!window.location.origin) {
          return window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
        }
        else {
        } else {
          return window.location.origin;
        }
      }
@@ -159,8 +156,7 @@
          var iframeUrl = sessionIframe.iframeUrl;
          if (iframeUrl.charAt(0) === '/') {
            sessionIframe.iframeOrigin = getOrigin();
          }
          else {
          } else {
            sessionIframe.iframeOrigin = iframeUrl.substring(0, iframeUrl.indexOf('/', 8));
          }
          promise.setSuccess();
@@ -192,8 +188,7 @@
            var promise = callbacks[i];
            if (event.data === 'unchanged') {
              promise.setSuccess();
            }
            else {
            } else {
              promise.setError();
            }
          }
@@ -229,8 +224,7 @@
          if (sessionIframe.callbackList.length === 1) {
            sessionIframe.iframe.contentWindow.postMessage(msg, origin);
          }
        }
        else {
        } else {
          promise.setSuccess();
        }

@@ -238,7 +232,11 @@
      }

      // Initialize the session check.
      $(document).once('keycloak').each(function () {
      if (!once('keycloak', 'html').length) {
        return;
      }

      $(document).each(function () {
        if (sessionIframe.enable && !sessionIframe.initialized) {
          setupSessionCheckIframe()
              .success(function () {
@@ -249,7 +247,6 @@
              });
        }
      });

    }
  };
})(jQuery, Drupal, drupalSettings);
})(Drupal, jQuery, once,  drupalSettings);
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ keycloak-session:
  js:
    js/keycloak-session.js: {}
  dependencies:
    - core/drupal
    - core/jquery
    - core/jquery.once
    - core/once
    - core/drupalSettings