From 1fea0b7b7c973996539adbd4be4ecc63857dcdfc Mon Sep 17 00:00:00 2001 From: LoganMMcDonald Date: Tue, 7 May 2024 09:12:35 -0700 Subject: [PATCH] refactor state setting --- .../config/install/weather_login.settings.yml | 2 +- web/modules/weather_login/weather_login.module | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/web/modules/weather_login/config/install/weather_login.settings.yml b/web/modules/weather_login/config/install/weather_login.settings.yml index 163879307..6574e1466 100644 --- a/web/modules/weather_login/config/install/weather_login.settings.yml +++ b/web/modules/weather_login/config/install/weather_login.settings.yml @@ -1,4 +1,4 @@ sso_login_path: '/saml/login' sso_login_text: 'Login via SSO' sso_cancel_path: '/' -sso_cancel_text: 'Cancel and return home' \ No newline at end of file +sso_cancel_text: 'Cancel and return home' diff --git a/web/modules/weather_login/weather_login.module b/web/modules/weather_login/weather_login.module index 3bfa72365..50725b43f 100644 --- a/web/modules/weather_login/weather_login.module +++ b/web/modules/weather_login/weather_login.module @@ -20,13 +20,10 @@ function weather_login_form_user_login_form_alter(&$form, FormStateInterface $fo $cancelText = $config->get('sso_cancel_text'); // Allow override for local login forms via $settings[] in settings.*.php - $settings_state = Settings::get('weather_login_local_form', 0); - if ($settings_state || $state) { - $state = 1; - } + $basicAuthSetting = Settings::get('weather_login_local_form', false); if ($loginPath) { - if (!$state) { + if (!$basicAuthSetting) { $form['name']['#access'] = false; $form['pass']['#access'] = false; $form['actions']['#access'] = false;