Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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,8 +95,10 @@ trait FotowebWidgetTrait {
'target' => '_blank',
],
'#url' => Url::fromRoute('media_fotoweb.oauth2_revoke'),
],
];
];
}
return $build;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment