Skip to content
Snippets Groups Projects
Commit 06563655 authored by J P's avatar J P Committed by Benjamin Melançon
Browse files

Issue #3241662 by RobLoach, squiggy, loze, gisle: Add toggle button to show...

Issue #3241662 by RobLoach, squiggy, loze, gisle: Add toggle button to show login form on error pages
parent 495281e3
Branches
Tags 8.x-1.0-beta2
No related merge requests found
......@@ -85,7 +85,7 @@ class CustomErrorController extends ControllerBase {
$login_form = '';
// If the user is not logged in, show the login form.
if (\Drupal::currentUser()->isAnonymous()) {
if (\Drupal::config('customerror.settings')->get("{$code}.enable_login") && \Drupal::currentUser()->isAnonymous()) {
// For reasons that are not clear to me, setting the form state redirect
// here has no effect, logging in at this form puts us on a custom error
......
......@@ -112,6 +112,11 @@ class CustomerrorSettingsForm extends ConfigFormBase {
'#description' => $this->t('Theme to be used on the error page.'),
'#default_value' => $config->get("{$code}.theme"),
];
$form[$code]['enable_login'] = [
'#type' => 'checkbox',
'#title' => $this->t('Enable login form for anonymous users.'),
'#default_value' => $config->get("{$code}.enable_login"),
];
}
$form['redirects'] = [
......
{{ description }}
LOGIN!
{{ login_form }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment