Commit 5a791b01 authored by Stephan Zeidler's avatar Stephan Zeidler Committed by Stephan Zeidler
Browse files

Issue #3292489 by szeidler: Revoke authentication button should only be shown for OAuth 2.0

parent 904fbb07
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ trait FotowebWidgetTrait {
    }

    // Create the widget using an <iframe>.
    return [
    $build = [
      'widget' => [
        '#type' => 'html_tag',
        '#tag' => 'iframe',
@@ -79,7 +79,11 @@ trait FotowebWidgetTrait {
          'height' => $widget_height,
        ],
      ],
      'revoke_authenticate_button' => [
    ];

    // Revoking is only necessary for OAuth 2.0 based integrations.
    if ($config->get('auth_type') === 'oauth2') {
      $build['revoke_authenticate_button'] = [
        '#type' => 'link',
        '#title' => $this->t('Revoke authentication with Fotoware'),
        '#attributes' => [
@@ -91,10 +95,12 @@ trait FotowebWidgetTrait {
          'target' => '_blank',
        ],
        '#url' => Url::fromRoute('media_fotoweb.oauth2_revoke'),
      ],
      ];
    }

    return $build;
  }

  /**
   * {@inheritdoc}
   */