Commit c6eba306 authored by João Ventura's avatar João Ventura
Browse files

Revert "Issue #3315326 by tuutti, jcnventura: 2.0.0-beta1 release added a...

Revert "Issue #3315326 by tuutti, jcnventura: 2.0.0-beta1 release added a dependency to file module, php syntax errors"

This reverts commit dbc52b24.
parent dbc52b24
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -5,5 +5,4 @@ core_version_requirement: ^8.8 || ^9 || ^10
package: 'User authentication'
configure: entity.openid_connect_client.list
dependencies:
  - drupal:file
  - externalauth:externalauth
+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ function openid_connect_form_user_form_alter(&$form, &$form_state) {
    return;
  }

  $account_form = $form['account'] ?? $form;
  $account_form = isset($form['account']) ? (&$form['account']) : (&$form);

  $account_form['current_pass']['#access'] = FALSE;
  $account_form['current_pass_required_values']['#value'] = [];
@@ -100,7 +100,7 @@ function openid_connect_form_user_form_alter(&$form, &$form_state) {
 * Implements hook_form_FORM_ID_alter() for user_profile_form.
 */
function openid_connect_form_user_profile_form_alter(&$form, &$form_state) {
  $account_form = $form['account'] ?? $form;
  $account_form = isset($form['account']) ? (&$form['account']) : (&$form);

  $account = \Drupal::currentUser();
  if (!empty($account_form['pass']['#access']) && !\Drupal::service('openid_connect.openid_connect')->hasSetPasswordAccess($account)) {
+0 −44
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\openid_connect\Functional;

use Drupal\Tests\BrowserTestBase;

/**
 * Functional test for openid connect clients.
 *
 * @todo Improve these.
 *
 * @group openid_connect
 */
class OpenIdConnectUiTest extends BrowserTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'openid_connect',
    'externalauth',
    'file',
  ];

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Tests the client list.
   */
  public function testClientList() {
    $this->drupalGet('/admin/config/people/openid-connect');
    $this->assertSession()->statusCodeEquals(403);

    $account = $this->createUser(['administer openid connect clients']);
    $this->drupalLogin($account);
    $this->drupalGet('/admin/config/people/openid-connect');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->pageTextContains('There are no openid connect client entities yet.');
  }

}