Commit 0eeb7231 authored by Florent Torregrosa's avatar Florent Torregrosa Committed by Florent Torregrosa
Browse files

Issue #3251412 by Grimreaper: Remove dependency on jquery.once

parent bd6d66b5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
name: 'Internationalization Single Sign-On'
description: 'Provides sso functionality over multi-lang multi-domain configuration.'
type: module
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.2 || ^10
package: 'Multilingual'
dependencies:
  - drupal:language
+1 −1
Original line number Diff line number Diff line
@@ -3,6 +3,6 @@ sso:
    js/i18n_sso.js: {}
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal
    - core/drupalSettings
    - core/once
+3 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 * If so, it logs in user on current website and reload page.
 */

(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, once) {

  'use strict';

@@ -21,7 +21,7 @@
   * user in.
   */
  Drupal.behaviors.i18n_sso.initLogin = function () {
    $(drupalSettings.i18n_sso.wrapperSelector).once('i18n_sso').each(function () {
    $(once('i18n_sso', drupalSettings.i18n_sso.wrapperSelector)).each(function () {
      var $div = $('<div id="sso-waiting">');
      $div.html(drupalSettings.i18n_sso.waiting);
      var $this = $(this);
@@ -72,4 +72,4 @@
    }
  };

})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, once);
+5 −0
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ class SsoAllowOrigin implements EventSubscriberInterface {
    $request = $event->getRequest();
    /** @var array|string $origin */
    $origin = $request->get('origin');

    if ($origin == NULL) {
      return;
    }

    $domain = str_replace('http://', '', $origin);
    $domain = str_replace('https://', '', $domain);
    if (in_array($domain, $allowedDomains)) {