Skip to content

Commit

Permalink
Fixed: Issue with admin login if SSO is enabled
Browse files Browse the repository at this point in the history
SUDHANSHU authored and SUDHANSHU committed Jun 21, 2018
1 parent 7a2ae55 commit 754051a
Showing 9 changed files with 16 additions and 12 deletions.
Binary file modified drupal-8/package/customer_identity_and_access_management.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -28,6 +28,9 @@ further information.

-- CHANGE LOG --

-- 8.x-3.13 --
* SSO related bug fixed.

-- 8.x-3.12 --
* Bug Fixed: Admin logout when SSO is enabled.

Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ type: module
description: 'Allow users to sign up through a registration form. User Registration offers fully customized options for collecting and updating user data.'
package: CIAM LoginRadius
configure: lr_ciam.settings_form
version: '8.x-3.12'
version: '8.x-3.13'
core: '8.x'
project: 'customer_identity_and_access_management'
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@ package: CIAM LoginRadius
dependencies:
- lr_ciam
configure: lr_hostedpage.settings_form
version: '8.x-3.12'
version: '8.x-3.13'
core: '8.x'
project: 'customer_identity_and_access_management'
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@ package: CIAM LoginRadius
dependencies:
- drupal:lr_ciam
- drupal:simple_oauth
version: '8.x-3.12'
version: '8.x-3.13'
core: '8.x'
project: 'customer_identity_and_access_management'
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ jQuery(document).ready(function () {
e.preventDefault();
var options = {};
options.onSuccess = function () {
window.location = drupalSettings.sso.frontUrl;
window.location = drupalSettings.sso.logoutUrl;
};
LRObject.init("logout", options);
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@ package: CIAM LoginRadius
dependencies:
- lr_ciam
configure: lr_sso.settings_form
version: '8.x-3.12'
version: '8.x-3.13'
core: '8.x'
project: 'customer_identity_and_access_management'
Original file line number Diff line number Diff line change
@@ -11,22 +11,23 @@ use Drupal\Core\Form\FormStateInterface;
* @param $hook
*/
function lr_sso_page_attachments(&$page) {
global $user;
$sso_config = \Drupal::config('lr_sso.settings');
$sl_config = \Drupal::config('lr_ciam.settings');
$site_name = $sl_config->get('sso_site_name');

if ($sso_config->get('sso_enable') == 1 && !empty($site_name)) {
$my_settings['frontUrl'] = Url::fromRoute('<front>')->setAbsolute()->toString();
$user = \Drupal::currentUser()->getRoles();
$my_settings['logoutUrl'] = Url::fromRoute('user.logout')->setAbsolute()->toString();

if ( \Drupal::currentUser()->isAnonymous()) {
if ( \Drupal::currentUser()->isAnonymous()) {

$my_settings['isNotLogin'] = true;
$my_settings['loginUrl'] = Url::fromRoute('user.login')->setAbsolute()->toString();
}
if ( !\Drupal::currentUser()->isAnonymous()) {
}
if ( !\Drupal::currentUser()->isAnonymous() && !in_array("administrator", $user)) {

$my_settings['isNotLoginThenLogout'] = true;
$my_settings['logoutUrl'] = Url::fromRoute('user.logout')->setAbsolute()->toString();
$my_settings['isNotLoginThenLogout'] = true;
}

$page['#cache']['contexts'][] = 'user.roles';

0 comments on commit 754051a

Please sign in to comment.